edit_command_buffer: Add line:col support for Sublime Text

This commit is contained in:
George Christou 2020-04-27 23:40:46 +01:00 committed by Johannes Altmanninger
parent 06658cd13b
commit 2bc4228d42

View File

@ -41,18 +41,21 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
set col (math $offset + 1)
set -l basename (string match -r '[^/]*$' -- $editor[1])
if contains $basename vi vim nvim
set -a editor +$line +"norm $col|" $f
else if contains $basename emacs emacsclient gedit kak
set -a editor +$line:$col $f
else if contains $basename nano
set -a editor +$line,$col $f
else if contains $basename joe ee
set -a editor +$line $f
else if contains $basename code code-oss
set -a editor --goto $f:$line:$col --wait
else
set -a editor $f
switch $basename
case vi vim nvim
set -a editor +$line +"norm $col|" $f
case emacs emacsclient gedit kak
set -a editor +$line:$col $f
case nano
set -a editor +$line,$col $f
case joe ee
set -a editor +$line $f
case code code-oss
set -a editor --goto $f:$line:$col --wait
case subl
set -a editor $f:$line:$col --wait
case '*'
set -a editor $f
end
__fish_disable_bracketed_paste