diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-07 14:08:03 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-07 14:08:03 +0000 |
commit | e664a327014f4aa8baf8549a34a4caab2f3116a3 (patch) | |
tree | dc75ceac6fc4f9868e5d4f383bb3d660a194cf67 | |
parent | 834d41853e12b9022f60b08c32480928c2a9e48f (diff) | |
download | vim-git-e664a327014f4aa8baf8549a34a4caab2f3116a3.tar.gz |
patch 8.2.4026: ml_get error with specific win_execute() commandv8.2.4026
Problem: ml_get error with specific win_execute() command. (Sean Dewar)
Solution: Check cursor and Visual area are OK.
-rw-r--r-- | src/evalwindow.c | 6 | ||||
-rw-r--r-- | src/testdir/test_execute_func.vim | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c index d29f3e4ba..2a97adcf2 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -743,6 +743,12 @@ f_win_execute(typval_T *argvars, typval_T *rettv) // Update the status line if the cursor moved. if (win_valid(wp) && !EQUAL_POS(curpos, wp->w_cursor)) wp->w_redr_status = TRUE; + + // In case the command moved the cursor or changed the Visual area, + // check it is valid. + check_cursor(); + if (VIsual_active) + check_pos(curbuf, &VIsual); } } diff --git a/src/testdir/test_execute_func.vim b/src/testdir/test_execute_func.vim index 0ca31cb6c..8cd5e7d27 100644 --- a/src/testdir/test_execute_func.vim +++ b/src/testdir/test_execute_func.vim @@ -153,8 +153,23 @@ func Test_win_execute_visual_redraw() call setline(1, ['a', 'b', 'c']) new wincmd p + " start Visual in current window, redraw in other window with fewer lines call feedkeys("G\<C-V>", 'txn') call win_execute(winnr('#')->win_getid(), 'redraw') + call feedkeys("\<Esc>", 'txn') + bwipe! + bwipe! + + enew + new + call setline(1, ['a', 'b', 'c']) + let winid = win_getid() + wincmd p + " start Visual in current window, extend it in other window with more lines + call feedkeys("\<C-V>", 'txn') + call win_execute(winid, 'call feedkeys("G\<C-V>", ''txn'')') + redraw + bwipe! bwipe! endfunc diff --git a/src/version.c b/src/version.c index b0bfc2919..40c83bfb4 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4026, +/**/ 4025, /**/ 4024, |