mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 22:33:51 -05:00
Fix staging partial hunk near EOF lacking newline
This is a blind, untested fix. Closes https://github.com/tpope/vim-fugitive/issues/1609
This commit is contained in:
@@ -3554,9 +3554,9 @@ function! s:StageApply(info, reverse, extra) abort
|
|||||||
if empty(filter(copy(lines), 'v:val =~# "^[+-]"'))
|
if empty(filter(copy(lines), 'v:val =~# "^[+-]"'))
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
while getline(end) =~# '^[-+ ]'
|
while getline(end) =~# '^[-+\ ]'
|
||||||
let end += 1
|
let end += 1
|
||||||
if getline(end) =~# '^[' . (a:reverse ? '+' : '-') . ' ]'
|
if getline(end) =~# '^[' . (a:reverse ? '+' : '-') . '\ ]'
|
||||||
call add(lines, ' ' . getline(end)[1:-1])
|
call add(lines, ' ' . getline(end)[1:-1])
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
|
|||||||
Reference in New Issue
Block a user