Distinguish normal and visual modes in map check.

Fixes #642.
This commit is contained in:
Andy Stewart
2019-08-13 19:22:04 +01:00
parent 070cfc531a
commit 71bbe88525

View File

@@ -126,10 +126,10 @@ function! gitgutter#setup_maps()
nmap <buffer> ]c <Plug>GitGutterNextHunk
endif
if !hasmapto('<Plug>GitGutterStageHunk') && maparg('<Leader>hs', 'x') ==# ''
if !hasmapto('<Plug>GitGutterStageHunk', 'v') && maparg('<Leader>hs', 'x') ==# ''
xmap <buffer> <Leader>hs <Plug>GitGutterStageHunk
endif
if !hasmapto('<Plug>GitGutterStageHunk') && maparg('<Leader>hs', 'n') ==# ''
if !hasmapto('<Plug>GitGutterStageHunk', 'n') && maparg('<Leader>hs', 'n') ==# ''
nmap <buffer> <Leader>hs <Plug>GitGutterStageHunk
endif
if !hasmapto('<Plug>GitGutterUndoHunk') && maparg('<Leader>hu', 'n') ==# ''