diff src/autocmd.c @ 16268:0f65f2808470 v8.1.1138

patch 8.1.1138: plugins don't get notified when the popup menu changes commit https://github.com/vim/vim/commit/d7f246c68cfb97406bcd4b098a2df2d870b3ef92 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 8 18:15:41 2019 +0200 patch 8.1.1138: plugins don't get notified when the popup menu changes Problem: Plugins don't get notified when the popup menu changes. Solution: Add the CompleteChanged event. (Andy Massimino. closes https://github.com/vim/vim/issues/4176)
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Apr 2019 18:30:06 +0200
parents 331dc836f866
children 3b2db762a509
line wrap: on
line diff
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -112,6 +112,7 @@ static struct event_name
     {"CmdUndefined",	EVENT_CMDUNDEFINED},
     {"ColorScheme",	EVENT_COLORSCHEME},
     {"ColorSchemePre",	EVENT_COLORSCHEMEPRE},
+    {"CompleteChanged",	EVENT_COMPLETECHANGED},
     {"CompleteDone",	EVENT_COMPLETEDONE},
     {"CursorHold",	EVENT_CURSORHOLD},
     {"CursorHoldI",	EVENT_CURSORHOLDI},
@@ -1794,6 +1795,17 @@ has_textyankpost(void)
 }
 #endif
 
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return TRUE when there is a CompleteChanged autocommand defined.
+ */
+    int
+has_completechanged(void)
+{
+    return (first_autopat[(int)EVENT_COMPLETECHANGED] != NULL);
+}
+#endif
+
 /*
  * Execute autocommands for "event" and file name "fname".
  * Return TRUE if some commands were executed.