Jump to specific lines
-
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!
-
then:
-
@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. -
Ah, okay, your desire is clearer now.
Here’s a THREAD that will show you some possibilities via scripting.
-
@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? -
@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 machinestartup.py
. If you don’t seestartup (User)
in your menus, you don’t have astartup.py
: -
@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! -
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.