To: vim_dev@googlegroups.com Subject: Patch 8.1.2124 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2124 Problem: Ruler is not updated if win_execute() moves cursor. Solution: Update the status line. (closes #5022) Files: src/evalwindow.c, src/testdir/test_execute_func.vim *** ../vim-8.1.2123/src/evalwindow.c 2019-09-23 21:16:51.387544361 +0200 --- src/evalwindow.c 2019-10-08 20:14:04.127049676 +0200 *************** *** 655,666 **** --- 655,672 ---- if (wp != NULL && tp != NULL) { + pos_T curpos = wp->w_cursor; + if (switch_win_noblock(&save_curwin, &save_curtab, wp, tp, TRUE) == OK) { check_cursor(); execute_common(argvars, rettv, 1); } restore_win_noblock(save_curwin, save_curtab, TRUE); + + // Update the status line if the cursor moved. + if (win_valid(wp) && !EQUAL_POS(curpos, wp->w_cursor)) + wp->w_redr_status = TRUE; } } *** ../vim-8.1.2123/src/testdir/test_execute_func.vim 2019-09-23 21:16:51.387544361 +0200 --- src/testdir/test_execute_func.vim 2019-10-08 20:14:04.127049676 +0200 *************** *** 1,5 **** --- 1,7 ---- " test execute() + source view_util.vim + func NestedEval() let nested = execute('echo "nested\nlines"') echo 'got: "' . nested . '"' *************** *** 101,106 **** --- 103,126 ---- bwipe! endfunc + func Test_win_execute_update_ruler() + enew + call setline(1, range(500)) + 20 + split + let winid = win_getid() + set ruler + wincmd w + let height = winheight(winid) + redraw + call assert_match('20,1', Screenline(height + 1)) + let line = win_execute(winid, 'call cursor(100, 1)') + redraw + call assert_match('100,1', Screenline(height + 1)) + + bwipe! + endfunc + func Test_win_execute_other_tab() let thiswin = win_getid() tabnew *** ../vim-8.1.2123/src/version.c 2019-10-07 22:38:54.816029419 +0200 --- src/version.c 2019-10-08 20:15:16.726739267 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 2124, /**/ -- Arthur pulls Pin out. The MONK blesses the grenade as ... ARTHUR: (quietly) One, two, five ... GALAHAD: Three, sir! ARTHUR: Three. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@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 ///