mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-10 04:23:46 -05:00
Enable :w in preview window to stage the hunk.
This commit is contained in:
@@ -315,6 +315,10 @@ function! s:preview(hunk_diff)
|
||||
call setline(1, body)
|
||||
normal! gg
|
||||
|
||||
cnoreabbrev <buffer> <expr> w getcmdtype() == ':' && getcmdline() == 'w' ? 'GitGutterStageHunk' : 'w'
|
||||
" Staging hunk from the preview window closes the window anyway.
|
||||
cnoreabbrev <buffer> <expr> wq getcmdtype() == ':' && getcmdline() == 'wq' ? 'GitGutterStageHunk' : 'wq'
|
||||
|
||||
noautocmd wincmd p
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user