diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e995b8c..4975bab 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1830,8 +1830,8 @@ function! fugitive#BufReadStatus() abort nnoremap R :echohl WarningMsgecho 'Reloading is automatic. Use :e to force'echohl NONE nnoremap g :echoerr 'Changed to X' xnoremap g :echoerr 'Changed to X' - nnoremap X :execute StageDelete(line('.'), line('.'), v:count) - xnoremap X :execute StageDelete(line("'<"), line("'<"), v:count) + nnoremap X :execute StageDelete(line('.'), 0, v:count) + xnoremap X :execute StageDelete(line("'<"), line("'>"), v:count) nnoremap . : =StageArgs(0) xnoremap . : =StageArgs(1) nnoremap :help fugitive-mappings @@ -2835,8 +2835,8 @@ function! s:StageApply(info, reverse, extra) abort call s:throw(output) endfunction -function! s:StageDelete(lnum, ignored, count) abort - let info = get(s:Selection(a:lnum, a:lnum), 0, {'filename': ''}) +function! s:StageDelete(lnum1, lnum2, count) abort + let info = get(s:Selection(a:lnum1, a:lnum2), 0, {'filename': ''}) if empty(info.filename) return '' endif @@ -2845,7 +2845,7 @@ function! s:StageDelete(lnum, ignored, count) abort if empty(hash) return '' elseif info.patch - call s:StageApply(info, 1, info.section ==# 'Staged' ? ['--index'] : []) + call s:StageApply(info, 1, info.section ==# 'Staged' ? ['--index'] : []) elseif info.status ==# '?' call s:TreeChomp('clean', '-f', '--', info.paths[0]) elseif a:count == 2