patch 8.1.1320: it is not possible to track changes to a buffer
Problem: It is not possible to track changes to a buffer.
Solution: Add listener_add() and listener_remove(). No docs or tests yet.
diff --git a/src/structs.h b/src/structs.h
index 16e5ce3..36bdf9a 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1873,6 +1873,19 @@
#endif
} jobopt_T;
+#ifdef FEAT_EVAL
+/*
+ * Structure used for listeners added with listener_add().
+ */
+typedef struct listener_S listener_T;
+struct listener_S
+{
+ listener_T *lr_next;
+ int lr_id;
+ char_u *lr_callback;
+ partial_T *lr_partial;
+};
+#endif
/* structure used for explicit stack while garbage collecting hash tables */
typedef struct ht_stack_S
@@ -2424,6 +2437,8 @@
#ifdef FEAT_EVAL
dictitem_T b_bufvar; /* variable for "b:" Dictionary */
dict_T *b_vars; /* internal variables, local to buffer */
+
+ listener_T *b_listener;
#endif
#ifdef FEAT_TEXT_PROP
int b_has_textprop; // TRUE when text props were added