summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-08 22:20:35 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-08 22:20:35 +0200
commit345f28df5482cd35f5fa74b06443376379f113b0 (patch)
treee1ad21b604881812680f765790e06304c44835aa
parentc3e555b22f24f93aabd31943c35a9228abb6ecb6 (diff)
downloadvim-git-345f28df5482cd35f5fa74b06443376379f113b0.tar.gz
patch 8.1.2124: ruler is not updated if win_execute() moves cursorv8.1.2124
Problem: Ruler is not updated if win_execute() moves cursor. Solution: Update the status line. (closes #5022)
-rw-r--r--src/evalwindow.c6
-rw-r--r--src/testdir/test_execute_func.vim20
-rw-r--r--src/version.c2
3 files changed, 28 insertions, 0 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c
index 6df14c592..76916936d 100644
--- a/src/evalwindow.c
+++ b/src/evalwindow.c
@@ -655,12 +655,18 @@ f_win_execute(typval_T *argvars, typval_T *rettv)
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;
}
}
diff --git a/src/testdir/test_execute_func.vim b/src/testdir/test_execute_func.vim
index f81a86b6a..2f02409de 100644
--- a/src/testdir/test_execute_func.vim
+++ b/src/testdir/test_execute_func.vim
@@ -1,5 +1,7 @@
" test execute()
+source view_util.vim
+
func NestedEval()
let nested = execute('echo "nested\nlines"')
echo 'got: "' . nested . '"'
@@ -101,6 +103,24 @@ func Test_win_execute()
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
diff --git a/src/version.c b/src/version.c
index f07d0382c..514f3c929 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2124,
+/**/
2123,
/**/
2122,