Re: Feature Request: Enabling opening files externally at a particular line number



On Sat, Mar 23, 2013 at 1:56 AM, Aaron Schrab <aaron schrab com> wrote:
At 16:17 +0100 21 Mar 2013, Konstantin <starojitski gmail com> wrote:

"$external_editor $file_path:$current_line_number"
would open the file at the right point! At least on Linux and probably on
Mac


That would be a feature of the editor, not the OS.  And that method doesn't
work for either of the traditionally popular Unix/Linux editors (emacs and
vi).  In fact I'd consider any editor that did that to be broken since a
colon is a perfectly valid part of a file name.

However both of those support:

"$external_editor +$current_line_number $file_path"

FWIW in TortoiseHg you can define an external editor. When you do so
you can define the command line that will be called when the editor is
open. In it you can use a few "variables", such as $FILE and $LINENUM.
With that you can customize how the editor is open, and _if_ your
editor command line contains $LINENUM you TortoiseHg will open the
file at the selected line number.

For example:

C:\Program Files\notepad++\notepad++.exe -n$LINENUM $FILE
vim -f +$LINENUM $FILE
emacs +$LINENUM $FILE
kate --line $LINENUM $FILE

and so on.

In fact the next version of TortoiseHg will ship with several of these
editors preconfigured. TortoiseHg will detect the editors that you
have installed and it will show them on a combobox on its settings so
that you can just select the one you want (rather than having to
configure it on your own, which you can still do).

Cheers,

Angel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]