mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Avoid error when mapcheck() and <unique> semantics differ
References: https://github.com/tpope/vim-fugitive/issues/1826
This commit is contained in:
@@ -219,7 +219,7 @@ function! s:Map(mode, lhs, rhs, ...) abort
|
||||
let head = substitute(head, '<[^<>]*>$\|.$', '', '')
|
||||
endwhile
|
||||
if !skip && (flags !~# '<unique>' || empty(mapcheck(head.tail, mode)))
|
||||
call add(maps, mode.'map <buffer>' . s:nowait . flags . ' ' . head.tail . ' ' . a:rhs)
|
||||
call add(maps, mode.'map <buffer>' . s:nowait . substitute(flags, '<unique>', '', '') . ' ' . head.tail . ' ' . a:rhs)
|
||||
if a:0 > 1
|
||||
let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') .
|
||||
\ '|sil! exe "' . mode . 'unmap <buffer> ' . head.tail . '"'
|
||||
|
||||
Reference in New Issue
Block a user