mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-13 05:43:53 -05:00
Add support for fish shell
The `&&` and the `||` operators aren't available in fish. The equivalents are `; and` and `; or`. Also single parentheses are used for command substitution. The fish equivalents are `begin` and `end`. But they aren't needed here.
This commit is contained in:
committed by
Andy Stewart
parent
fe10e6474d
commit
0ca15c8ad2
@@ -131,7 +131,8 @@ function! gitgutter#utility#file_relative_to_repo_root()
|
||||
endfunction
|
||||
|
||||
function! gitgutter#utility#command_in_directory_of_file(cmd)
|
||||
return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . ' && ' . a:cmd
|
||||
let l:fish = &shell =~# 'fish'
|
||||
return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . (l:fish ? '; and ' : ' && ') . a:cmd
|
||||
endfunction
|
||||
|
||||
function! gitgutter#utility#highlight_name_for_change(text)
|
||||
|
||||
Reference in New Issue
Block a user