Only check bdelete mapping in normal mode

This commit is contained in:
ganziqim 2019-07-18 12:02:28 +08:00 committed by Tim Pope
parent 07661dc102
commit 58b2b85c9e

View File

@ -1813,7 +1813,7 @@ function! fugitive#BufReadStatus() abort
nnoremap <buffer> <silent> dv :<C-U>execute <SID>StageDiff('Gvdiffsplit')<CR>
nnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>
xnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
if empty(mapcheck('q'))
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>
endif
exe 'nnoremap <buffer> <silent>' s:nowait "gq :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>"
@ -2041,7 +2041,7 @@ function! s:SetupTemp(file) abort
setlocal foldmarker=<<<<<<<,>>>>>>>
setlocal bufhidden=delete nobuflisted
setlocal buftype=nowrite
if empty(mapcheck('q'))
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :<C-U>bdelete<CR>
endif
exe 'nnoremap <buffer> <silent>' s:nowait "gq :<C-U>bdelete<CR>"
@ -4378,7 +4378,7 @@ function! s:BlameCommand(line1, line2, range, count, bang, mods, reg, arg, args)
let nowait = v:version >= 704 ? '<nowait>' : ''
nnoremap <buffer> <silent> <F1> :help fugitive-:Gblame<CR>
nnoremap <buffer> <silent> g? :help fugitive-:Gblame<CR>
if empty(mapcheck('q'))
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w<Bar>'.bufnr('').'bdelete','^-1','','')<CR>
endif
exe 'nnoremap <buffer> <silent>' s:nowait "gq :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w<Bar>'.bufnr('').'bdelete<Bar>if expand(''%:p'') =~# ''^fugitive:[\\/][\\/]''<Bar>Gedit<Bar>endif','^-1','','')<CR>"