vim-patch:8.2.5022: 'completefunc'/'omnifunc' error does not end completion (#19083)

Problem:    'completefunc'/'omnifunc' error does not end completion.
Solution:   Check if there was an error or exception. (closes vim/vim#10486,
            closes vim/vim#4218)
9bcb9ca9c7
This commit is contained in:
zeertzjq
2022-06-25 18:38:35 +08:00
committed by GitHub
parent 5c2c88717a
commit a5175fe489
2 changed files with 29 additions and 4 deletions

View File

@@ -5263,12 +5263,13 @@ static int ins_complete(int c, bool enable_pum)
return FAIL;
}
/* Return value -2 means the user complete function wants to
* cancel the complete without an error.
* Return value -3 does the same as -2 and leaves CTRL-X mode.*/
if (col == -2) {
// Return value -2 means the user complete function wants to cancel the
// complete without an error, do the same if the function did not execute
// successfully.
if (col == -2 || aborting()) {
return FAIL;
}
// Return value -3 does the same as -2 and leaves CTRL-X mode.
if (col == -3) {
ctrl_x_mode = CTRL_X_NORMAL;
edit_submode = NULL;