vim-patch:8.2.2426: allowing 'completefunc' to switch windows causes trouble

Problem:    Allowing 'completefunc' to switch windows causes trouble.
Solution:   use "textwinlock" instead of "textlock".
28976e2acc

Assert E565 instead of E578.

vim-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.
6adb9ea0a6

vim-patch:8.2.5029: "textlock" is always zero

Problem:    "textlock" is always zero.
Solution:   Remove "textlock" and rename "textwinlock" to "textlock".
            (closes vim/vim#10489)
cfe456543e
This commit is contained in:
zeertzjq
2022-07-17 11:47:34 +08:00
parent b0bbcfa239
commit f72ec95958
6 changed files with 16 additions and 29 deletions

View File

@@ -1062,11 +1062,6 @@ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr)
return;
}
const int save_textlock = textlock;
// "textlock" is set when evaluating 'completefunc' but we can change text
// here.
textlock = 0;
// Check for undo allowed here, because if something was already inserted
// the line was already saved for undo and this check isn't done.
if (!undo_allowed(curbuf)) {
@@ -1081,7 +1076,6 @@ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr)
set_completion(startcol - 1, argvars[1].vval.v_list);
}
}
textlock = save_textlock;
}
/// "complete_add()" function