aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 3cfc00fea2..b16041b832 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -2193,6 +2193,13 @@ static void f_win_execute(typval_T *argvars, typval_T *rettv, FunPtr fptr)
if (win_valid(wp) && !equalpos(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);
+ }
}
}