mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
vim-patch:8.1.0458: ml_get error and crash when using "do"
Problem: Ml_get error and crash when using "do".
Solution: Adjust cursor position also when diffupdate is not needed.
(Hirohito Higashi)
df77cef92e
This commit is contained in:
@@ -2739,15 +2739,19 @@ void ex_diffgetput(exarg_T *eap)
|
|||||||
theend:
|
theend:
|
||||||
diff_busy = false;
|
diff_busy = false;
|
||||||
if (diff_need_update) {
|
if (diff_need_update) {
|
||||||
diff_need_update = false;
|
|
||||||
ex_diffupdate(NULL);
|
ex_diffupdate(NULL);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// Check that the cursor is on a valid character and update it's
|
// Check that the cursor is on a valid character and update it's
|
||||||
// position. When there were filler lines the topline has become
|
// position. When there were filler lines the topline has become
|
||||||
// invalid.
|
// invalid.
|
||||||
check_cursor();
|
check_cursor();
|
||||||
changed_line_abv_curs();
|
changed_line_abv_curs();
|
||||||
|
|
||||||
|
if (diff_need_update) {
|
||||||
|
// redraw already done by ex_diffupdate()
|
||||||
|
diff_need_update = false;
|
||||||
|
} else {
|
||||||
// Also need to redraw the other buffers.
|
// Also need to redraw the other buffers.
|
||||||
diff_redraw(false);
|
diff_redraw(false);
|
||||||
apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, false, curbuf);
|
apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, false, curbuf);
|
||||||
|
@@ -275,6 +275,28 @@ func Test_dp_do_buffer()
|
|||||||
%bwipe!
|
%bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_do_lastline()
|
||||||
|
e! one
|
||||||
|
call setline(1, ['1','2','3','4','5','6'])
|
||||||
|
diffthis
|
||||||
|
|
||||||
|
new two
|
||||||
|
call setline(1, ['2','4','5'])
|
||||||
|
diffthis
|
||||||
|
|
||||||
|
1
|
||||||
|
norm dp]c
|
||||||
|
norm dp]c
|
||||||
|
wincmd w
|
||||||
|
call assert_equal(4, line('$'))
|
||||||
|
norm G
|
||||||
|
norm do
|
||||||
|
call assert_equal(3, line('$'))
|
||||||
|
|
||||||
|
windo diffoff
|
||||||
|
%bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_diffoff()
|
func Test_diffoff()
|
||||||
enew!
|
enew!
|
||||||
call setline(1, ['Two', 'Three'])
|
call setline(1, ['Two', 'Three'])
|
||||||
|
Reference in New Issue
Block a user