Use known shell for hunk staging, previewing, undoing.

Forgot to do this in 377c71d.

Closes #352.
This commit is contained in:
Andy Stewart
2016-06-27 10:55:26 +01:00
parent c8fa0b3349
commit b5f23e9867

View File

@@ -170,6 +170,7 @@ endfunction
" Hunks {{{ " Hunks {{{
function! gitgutter#stage_hunk() abort function! gitgutter#stage_hunk() abort
call gitgutter#utility#use_known_shell()
if gitgutter#utility#is_active() if gitgutter#utility#is_active()
" Ensure the working copy of the file is up to date. " Ensure the working copy of the file is up to date.
" It doesn't make sense to stage a hunk otherwise. " It doesn't make sense to stage a hunk otherwise.
@@ -189,9 +190,11 @@ function! gitgutter#stage_hunk() abort
silent! call repeat#set("\<Plug>GitGutterStageHunk", -1)<CR> silent! call repeat#set("\<Plug>GitGutterStageHunk", -1)<CR>
endif endif
call gitgutter#utility#restore_shell()
endfunction endfunction
function! gitgutter#undo_hunk() abort function! gitgutter#undo_hunk() abort
call gitgutter#utility#use_known_shell()
if gitgutter#utility#is_active() if gitgutter#utility#is_active()
" Ensure the working copy of the file is up to date. " Ensure the working copy of the file is up to date.
" It doesn't make sense to stage a hunk otherwise. " It doesn't make sense to stage a hunk otherwise.
@@ -214,9 +217,11 @@ function! gitgutter#undo_hunk() abort
silent! call repeat#set("\<Plug>GitGutterUndoHunk", -1)<CR> silent! call repeat#set("\<Plug>GitGutterUndoHunk", -1)<CR>
endif endif
call gitgutter#utility#restore_shell()
endfunction endfunction
function! gitgutter#preview_hunk() abort function! gitgutter#preview_hunk() abort
call gitgutter#utility#use_known_shell()
if gitgutter#utility#is_active() if gitgutter#utility#is_active()
" Ensure the working copy of the file is up to date. " Ensure the working copy of the file is up to date.
" It doesn't make sense to stage a hunk otherwise. " It doesn't make sense to stage a hunk otherwise.
@@ -242,6 +247,7 @@ function! gitgutter#preview_hunk() abort
wincmd p wincmd p
endif endif
endif endif
call gitgutter#utility#restore_shell()
endfunction endfunction
" }}} " }}}