From 0840f001feadf967898deadf977d4e7b2f35eaf4 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 5 Sep 2021 10:00:39 -0400 Subject: [PATCH] Avoid error when mapcheck() and semantics differ References: https://github.com/tpope/vim-fugitive/issues/1826 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index d4fd752..5017e11 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -219,7 +219,7 @@ function! s:Map(mode, lhs, rhs, ...) abort let head = substitute(head, '<[^<>]*>$\|.$', '', '') endwhile if !skip && (flags !~# '' || empty(mapcheck(head.tail, mode))) - call add(maps, mode.'map ' . s:nowait . flags . ' ' . head.tail . ' ' . a:rhs) + call add(maps, mode.'map ' . s:nowait . substitute(flags, '', '', '') . ' ' . head.tail . ' ' . a:rhs) if a:0 > 1 let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') . \ '|sil! exe "' . mode . 'unmap ' . head.tail . '"'