From 71bbe88525c0b36f4f3843a2a577442bbd7fd957 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 13 Aug 2019 19:22:04 +0100 Subject: [PATCH] Distinguish normal and visual modes in map check. Fixes #642. --- autoload/gitgutter.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/gitgutter.vim b/autoload/gitgutter.vim index b413834..1f237ab 100644 --- a/autoload/gitgutter.vim +++ b/autoload/gitgutter.vim @@ -126,10 +126,10 @@ function! gitgutter#setup_maps() nmap ]c GitGutterNextHunk endif - if !hasmapto('GitGutterStageHunk') && maparg('hs', 'x') ==# '' + if !hasmapto('GitGutterStageHunk', 'v') && maparg('hs', 'x') ==# '' xmap hs GitGutterStageHunk endif - if !hasmapto('GitGutterStageHunk') && maparg('hs', 'n') ==# '' + if !hasmapto('GitGutterStageHunk', 'n') && maparg('hs', 'n') ==# '' nmap hs GitGutterStageHunk endif if !hasmapto('GitGutterUndoHunk') && maparg('hu', 'n') ==# ''