+1

Option to open reviewed file in editor (on selected line)

Jan Ryšavý 2 months ago updated 2 months ago 2

It would be great to have an option to open reviewed file in selected text editor.


For example I find some typo like missing space:


I would like to open file in my text editor (in my case VS2019) on highlighted line.


Just for reference I'm attaching code for opening VS on selected line. It would mean support also VS Code and other major text editors (maybe some configuration and external commands?)

openedit.cpp

I know of 3 ways built in to SG that do most of what you want


1. The Changes view has a context menu option of "Edit in Index Editor" which edits the file at the viewed location.  I use that for tiny tweaks like the one you mention.

2. The Files view context menu option also has "Index Editor" (which is conveniently mapped to Ctrl+Alt+t) and opens a larger-pane editor.


3. The Files view context menu also has a context menu option of "Open from Working Tree" which sends the file to the OS-mapped program for the file type; however, not at the viewed line.

A fourth option is to configure an external tool using

  Preferences -> Tools -> Add...

and it's available on the Tools menu.  I've configured external tools this way - very helpful.

Thank you Jeff!

A fourth option could be probably a viable solution. I can imagine configuration could be extended to pass currently selected line as parameter.