mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 02:13:38 +08:00
edit_command_buffer: Add line:col support for Sublime Text
This commit is contained in:
parent
06658cd13b
commit
2bc4228d42
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user