Make "q" error maps consistent

This commit is contained in:
Tim Pope
2021-08-31 09:21:00 -04:00
parent b64c426fd2
commit 328501d4f0

View File

@@ -2729,7 +2729,7 @@ function! fugitive#BufReadStatus() abort
call s:Map('n', 'I', ":<C-U>execute <SID>StagePatch(line('.'),line('.'))<CR>", '<silent>')
call s:Map('x', 'I', ":<C-U>execute <SID>StagePatch(line(\"'<\"),line(\"'>\"))<CR>", '<silent>')
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :echoerr "fugitive: q removed in favor of gq (or :q)"<CR>
nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q is removed in favor of gq (or :q)"<CR>
endif
call s:Map('n', 'gq', ":<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>", '<silent>')
call s:Map('n', 'R', ":echohl WarningMsg<Bar>echo 'Reloading is automatic. Use :e to force'<Bar>echohl NONE<CR>", '<silent>')
@@ -6901,8 +6901,8 @@ function! fugitive#BlameFileType() abort
endif
call s:Map('n', '<F1>', ':help :Git_blame<CR>', '<silent>')
call s:Map('n', 'g?', ':help :Git_blame<CR>', '<silent>')
if mapcheck('q', 'n') =~# '^$\|bdelete'
call s:Map('n', 'q', ':echoerr "fugitive: q removed in favor of gq (or :q)"<CR>', '<silent>')
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q removed in favor of gq (or :q)"<CR>
endif
call s:Map('n', 'gq', ':exe <SID>BlameQuit()<CR>', '<silent>')
call s:Map('n', '<2-LeftMouse>', ':<C-U>exe <SID>BlameCommit("exe <SID>BlameLeave()<Bar>edit")<CR>', '<silent>')