Clarify :Gstatus p behavior

I've seen a lot of confusion in the wild around this, and the old
behavior is immortalized in the Vimcasts.  Lets make this an error while
we regroup.
This commit is contained in:
Tim Pope 2019-08-14 00:51:48 -04:00
parent 53e5e61afa
commit 1d2821f91e
2 changed files with 7 additions and 0 deletions

View File

@ -1844,6 +1844,8 @@ function! fugitive#BufReadStatus() abort
nnoremap <buffer> <silent> d? :<C-U>help fugitive_d<CR> nnoremap <buffer> <silent> d? :<C-U>help fugitive_d<CR>
nnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<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> xnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
call s:Map('n', 'p', ":<C-U>if v:count<Bar>silent exe <SID>GF('pedit')<Bar>else<Bar>echoerr 'Use = for inline diff, P for :Git add/reset --patch, 1p for :pedit'<Bar>endif<CR>", '<silent>')
call s:Map('x', 'p', ":<C-U>execute <SID>StagePatch(line(\"'<\"),line(\"'>\"))<CR>", '<silent>')
nnoremap <buffer> <silent> I :<C-U>execute <SID>StagePatch(line('.'),line('.'))<CR> nnoremap <buffer> <silent> I :<C-U>execute <SID>StagePatch(line('.'),line('.'))<CR>
xnoremap <buffer> <silent> I :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR> xnoremap <buffer> <silent> I :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
if empty(mapcheck('q', 'n')) if empty(mapcheck('q', 'n'))

View File

@ -332,6 +332,11 @@ gO Open the file or |fugitive-object| under the cursor in
O Open the file or |fugitive-object| under the cursor in O Open the file or |fugitive-object| under the cursor in
a new tab. a new tab.
*fugitive_p*
p Open the file or |fugitive-object| under the cursor in
a preview window. In the status buffer, 1p is
required to bypass the legacy usage instructions.
*fugitive_~* *fugitive_~*
~ Open the current file in the [count]th first ancestor. ~ Open the current file in the [count]th first ancestor.