Patch 8.1.1932

8 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 27, 2019, 3:56:52 PM8/27/19
to vim...@googlegroups.com

Patch 8.1.1932
Problem: Ml_get errors after using append(). (Alex Genco)
Solution: Do not update the cursor twice. (closes #1737)
Files: src/evalfunc.c, src/testdir/test_functions.vim


*** ../vim-8.1.1931/src/evalfunc.c 2019-08-24 22:58:08.307264136 +0200
--- src/evalfunc.c 2019-08-27 21:52:37.244408025 +0200
***************
*** 1440,1447 ****
tabpage_T *tp;

appended_lines_mark(append_lnum, added);
FOR_ALL_TAB_WINDOWS(tp, wp)
! if (wp->w_buffer == buf && wp->w_cursor.lnum > append_lnum)
wp->w_cursor.lnum += added;
check_cursor_col();
update_topline();
--- 1440,1453 ----
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_buffer != curbuf || wp == curwin)
! && wp->w_cursor.lnum > append_lnum)
wp->w_cursor.lnum += added;
check_cursor_col();
update_topline();
*** ../vim-8.1.1931/src/testdir/test_functions.vim 2019-08-24 20:49:58.825320302 +0200
--- src/testdir/test_functions.vim 2019-08-27 21:30:17.852954344 +0200
***************
*** 705,710 ****
--- 705,719 ----
set complete&
endfunc

+ func Test_append()
+ enew!
+ split
+ call append(0, ["foo"])
+ split
+ only
+ undo
+ endfunc
+
func Test_getbufvar()
let bnr = bufnr('%')
let b:var_num = '1234'
*** ../vim-8.1.1931/src/version.c 2019-08-26 22:38:17.913955335 +0200
--- src/version.c 2019-08-27 21:37:20.850449015 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1932,
/**/

--
"Microsoft is like Coke. It's a secret formula, all the money is from
distribution, and their goal is to get Coke everywhere. Open source is like
selling water. There are water companies like Perrier and Poland Spring, but
you're competing with something that's free." -- Carl Howe


/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages