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 #4176)
diff --git a/src/autocmd.c b/src/autocmd.c
index aa11143..2ea23cc 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -112,6 +112,7 @@
{"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 @@
}
#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.