Community
    • Login

    Jump to specific lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 2 Posters 31.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jürgen ThomasJ
      Jürgen Thomas
      last edited by

      Hello all!

      Is there a way to write something that makes NP++ jump to a specific line? I think of something like the <file://path_to_file.filename> function, that opens a specific file but instead NP++ jumps to the specific line in the same file?

      Thanks in advance!

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Jürgen Thomas
        last edited by

        @Jürgen-Thomas

        ed6f0297-06d2-4e14-b9a1-4851feab25f6-image.png

        then:

        3d7ddd5a-e730-42a8-85eb-e67f208ce5e9-image.png

        Jürgen ThomasJ 1 Reply Last reply Reply Quote 0
        • Jürgen ThomasJ
          Jürgen Thomas @Alan Kilborn
          last edited by

          @Alan-Kilborn thanks for your answer but that’s not exactly what I need.
          What I was searching for is the function that I can click on something in the text or to be more precise that I can set smth. like “a path” to the line I want to navigate to.
          When you set <file://path_to_file.filename> and click on it, it will open the file you asked for. I want the same for jumping to the specifig line.

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn
            last edited by Alan Kilborn

            @Jürgen-Thomas

            Ah, okay, your desire is clearer now.

            Here’s a THREAD that will show you some possibilities via scripting.

            Jürgen ThomasJ 1 Reply Last reply Reply Quote 1
            • Jürgen ThomasJ
              Jürgen Thomas @Alan Kilborn
              last edited by

              @Alan-Kilborn hello again,
              I followed your instructions in the thread but the script does not work on my machine. Where do I have to save the file to? In the same folder as startup.py?

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn @Jürgen Thomas
                last edited by Alan Kilborn

                @Jürgen-Thomas said in Jump to specific lines:

                I followed your instructions in the thread but the script does not work on my machine.

                I just re-followed those instructions on a relatively virgin setup and didn’t have any trouble making it work. Are you sure that you did everything in the instructions? If you’re not already versed in PythonScripting, there’s some general guidance HERE.

                Where do I have to save the file to? In the same folder as startup.py?

                Yes, that’s the best place. There is a method for organizing related scripts into subfolders, but it requires some additional code in startup.py to make that work.

                Usually for users with just a few scripts, or to “just try something out”, the recommendation is to put a script in the same folder as startup.py.

                Note that this is user startup.py, not machine startup.py. If you don’t see startup (User) in your menus, you don’t have a startup.py:

                5744c618-b713-49f5-80fd-699e205c166d-image.png

                Jürgen ThomasJ 1 Reply Last reply Reply Quote 1
                • Jürgen ThomasJ
                  Jürgen Thomas @Alan Kilborn
                  last edited by

                  @Alan-Kilborn thank you so much!
                  The guidance was exactly what I needed! I was confused by the machine and user difference but now everything is very clear to me. Very good guide!

                  1 Reply Last reply Reply Quote 1
                  • Alan KilbornA
                    Alan Kilborn
                    last edited by

                    When I said before:

                    There is a method for organizing related scripts into subfolders, but it requires some additional code in startup.py to make that work.

                    For more detail on that, see HERE.

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors