patch 8.2.0670: cannot change window when evaluating 'completefunc'
Problem: Cannot change window when evaluating 'completefunc'.
Solution: Make a difference between not changing text or buffers and also
not changing window.
diff --git a/src/map.c b/src/map.c
index 85c46a5..2e20d40 100644
--- a/src/map.c
+++ b/src/map.c
@@ -1570,14 +1570,14 @@
// Forbid changing text or using ":normal" to avoid most of the bad side
// effects. Also restore the cursor position.
- ++textlock;
+ ++textwinlock;
++ex_normal_lock;
set_vim_var_char(c); // set v:char to the typed character
save_cursor = curwin->w_cursor;
save_msg_col = msg_col;
save_msg_row = msg_row;
p = eval_to_string(expr, NULL, FALSE);
- --textlock;
+ --textwinlock;
--ex_normal_lock;
curwin->w_cursor = save_cursor;
msg_col = save_msg_col;