mirror of
https://github.com/vim/vim.git
synced 2025-10-13 06:54:15 -04:00
patch 8.1.1932: ml_get errors after using append()
Problem: Ml_get errors after using append(). (Alex Genco) Solution: Do not update the cursor twice. (closes #1737)
This commit is contained in:
@@ -1440,8 +1440,14 @@ set_buffer_lines(
|
||||
tabpage_T *tp;
|
||||
|
||||
appended_lines_mark(append_lnum, added);
|
||||
|
||||
// Only adjust the cursor for buffers other than the current, unless it
|
||||
// is the current window. For curbuf and other windows it has been
|
||||
// done in mark_adjust_internal().
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == buf && wp->w_cursor.lnum > append_lnum)
|
||||
if (wp->w_buffer == buf
|
||||
&& (wp->w_buffer != curbuf || wp == curwin)
|
||||
&& wp->w_cursor.lnum > append_lnum)
|
||||
wp->w_cursor.lnum += added;
|
||||
check_cursor_col();
|
||||
update_topline();
|
||||
|
Reference in New Issue
Block a user