diff src/insexpand.c @ 29000:7d28903e80df v8.2.5022

patch 8.2.5022: 'completefunc'/'omnifunc' error does not end completion Commit: https://github.com/vim/vim/commit/9bcb9ca9c7dd1632385dc3351b5e019739368658 Author: LemonBoy <thatlemon@gmail.com> Date: Thu May 26 15:23:26 2022 +0100 patch 8.2.5022: 'completefunc'/'omnifunc' error does not end completion Problem: 'completefunc'/'omnifunc' error does not end completion. Solution: Check if there was an error or exception. (closes https://github.com/vim/vim/issues/10486, closes #4218)
author Bram Moolenaar <Bram@vim.org>
date Thu, 26 May 2022 16:30:02 +0200
parents 6cdf55afaae9
children 45c182c4f7e9
line wrap: on
line diff
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -4522,11 +4522,12 @@ get_userdefined_compl_info(colnr_T curs_
 	return FAIL;
     }
 
-    // Return value -2 means the user complete function wants to
-    // cancel the complete without an error.
+    // 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 == -2)
-	return FAIL;
     if (col == -3)
     {
 	ctrl_x_mode = CTRL_X_NORMAL;