mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Only do "guessed" :Gwrite behaviors with no argument
These seem pretty silly these days and should probably be removed, but let's start by reducing their scope.
This commit is contained in:
@@ -5058,9 +5058,9 @@ endfunction
|
||||
" Section: :Gwrite, :Gwq
|
||||
|
||||
function! fugitive#WriteCommand(line1, line2, range, bang, mods, arg, args) abort
|
||||
if s:cpath(expand('%:p'), fugitive#Find('.git/COMMIT_EDITMSG'))
|
||||
if s:cpath(expand('%:p'), fugitive#Find('.git/COMMIT_EDITMSG')) && empty(a:arg)
|
||||
return (empty($GIT_INDEX_FILE) ? 'write|bdelete' : 'wq') . (a:bang ? '!' : '')
|
||||
elseif get(b:, 'fugitive_type', '') ==# 'index'
|
||||
elseif get(b:, 'fugitive_type', '') ==# 'index' && empty(a:arg)
|
||||
return 'Git commit'
|
||||
elseif &buftype ==# 'nowrite' && getline(4) =~# '^[+-]\{3\} '
|
||||
return 'echoerr ' . string('fugitive: :Gwrite from :Git diff has been removed in favor of :Git add --edit')
|
||||
|
||||
Reference in New Issue
Block a user