#### sulliwk06

• Junior Community Member
• Posts: 3
• Hero Points: 1
« on: October 12, 2017, 06:06:52 pm »
I've been trying to wrestle with this for a while with no luck, so I thought I would ask if anyone has found a way to do it.  I'd like to add some links to my code to jump to a particular line in a particular file.

For example:
file://path\to\file#line=475

The closest method I could find to do that was to change the "Open Application" In "Options>Languages>File Extension Manager" to point to a batch file I made which parses out the line number and calls "vs "%Filename%" "-#goto-line %LineNumber%"".
The problem is that it seems I can't even get my batch file called because the file protocol recognizes that "path\to\file#line=475" isn't a file, giving me the error "Windows cannot find 'file...' Make sure you typed the name correctly, and then try again."

Does anyone have another way of doing something like this?  Should I make this some feature request?

I am running SlickEdit 2012 (v17.0.3.0 64-bit)

#### Graeme

• Senior Community Member
• Posts: 2125
• Hero Points: 261
« Reply #1 on: October 13, 2017, 10:44:54 am »
Not sure if this is what you're looking for but if you put the cursor on the line with file:// and run the command flink it will open that file at the specified line.  If the line starts with http it will open it in a browser.  Right click in slick edit window and select "edit this menu" and add the flink command to the menu if you want to be able to do right click -> flink.

Code: [Select]
_command void flink() name_info(','){   _str s1, s2, s3;      get_line(s1);   if ( pos('http',s1) == 1  ) {      safe_goto_url(s1);      return;   }   parse s1 with 'file://' s2 '#line=' s3;   s2 = maybe_quote_filename(s2);   if ( file_exists(s2) ) {      edit(s2);      goto_line(s3);   }   else {      message("no such file " :+ s2);   }}

#### Dennis

• SlickEdit Team Member
• Senior Community Member
• Posts: 2389
• Hero Points: 328