Author Topic: Startup Option to Show Specific Line Number  (Read 1688 times)

brebey

  • Community Member
  • Posts: 58
  • Hero Points: 2
Startup Option to Show Specific Line Number
« on: March 19, 2018, 03:09:57 PM »
I'd use SE as the editor/viewer that gets launched by a file search program that I use.

It works great, but unlike the search program's native viewer, SE of course shows the first page of the target file;  the native viewer will scroll to the line with the found text.

Is there a way to start SE and tell it to not only show a given file, but to scroll to a given line number within that file?

Alternatively, is there a way to start SE and tell it to not only load a file, but run a script after loading it? I could easily write a macro to scroll to a line number specified on the command line, assuming I can access command line arguments from script.

Thanks for any help!
 

brebey

  • Community Member
  • Posts: 58
  • Hero Points: 2
Re: Startup Option to Show Specific Line Number
« Reply #1 on: March 19, 2018, 03:41:29 PM »
I figured out a way to do precisely what I was looking for.
In case anyone else is interested, SE has a way to execute a command after loading a file, so I was able to specify "goto-line" as the command, and it looks like this:

"C:\Program Files\SlickEditV18.0.1 x64\win\vs.exe" "%path%" "-#goto-line %line%"

%path% and %line% are variables available in my Search program for just such a purpose.