• Login
Community
  • Login

Jump to specific lines

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 2 Posters 32.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
    Jürgen Thomas
    last edited by Aug 29, 2022, 10:26 AM

    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!

    A 1 Reply Last reply Aug 29, 2022, 12:00 PM Reply Quote 1
    • A
      Alan Kilborn @Jürgen Thomas
      last edited by Aug 29, 2022, 12:00 PM

      @Jürgen-Thomas

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

      then:

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

      J 1 Reply Last reply Aug 29, 2022, 12:23 PM Reply Quote 0
      • J
        Jürgen Thomas @Alan Kilborn
        last edited by Aug 29, 2022, 12:23 PM

        @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
        • A
          Alan Kilborn
          last edited by Alan Kilborn Aug 29, 2022, 12:30 PM Aug 29, 2022, 12:29 PM

          @Jürgen-Thomas

          Ah, okay, your desire is clearer now.

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

          J 1 Reply Last reply Aug 29, 2022, 1:27 PM Reply Quote 1
          • J
            Jürgen Thomas @Alan Kilborn
            last edited by Aug 29, 2022, 1:27 PM

            @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 ?

            A 1 Reply Last reply Aug 29, 2022, 1:48 PM Reply Quote 0
            • A
              Alan Kilborn @Jürgen Thomas
              last edited by Alan Kilborn Aug 29, 2022, 1:50 PM Aug 29, 2022, 1:48 PM

              @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 1 Reply Last reply Aug 29, 2022, 2:07 PM Reply Quote 1
              • J
                Jürgen Thomas @Alan Kilborn
                last edited by Aug 29, 2022, 2:07 PM

                @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
                • A
                  Alan Kilborn
                  last edited by Aug 29, 2022, 2:13 PM

                  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
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors