jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.27k stars 605 forks source link

When editor is set to subl, cannot locate the line #1322

Closed weichuliu closed 2 months ago

weichuliu commented 3 months ago

Hi, I am trying to set TIG_EDITOR=subl to edit with Sublime Text when pressing e.

When using vim, it's very convenient to directly locate the line. However, this is not working for Sublime.

The reason is that tig pass +[line-number] to vim, but Sublime cannot understand such syntax. On sublime, it will open a +[line] empty file instead.

For Sublime, the proper syntax will be subl [filename]:[line-number] and the Sublime will open the file and focus on the target line number. Can this be configured in tigrc?

Thanks very much.

krobelus commented 3 months ago

you can write a wrapper script that accepts +[line-number] and translates that to the sublime syntax

weichuliu commented 3 months ago

As a workaround, yes. But can we have an official support in tig?

koutcher commented 2 months ago

Most probably not, this is maybe the only thing on which vi and emacs agree, and yet, someone had to come up with another syntax...