aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 771ca732f4..2805a7d74e 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1229,6 +1229,16 @@ static void normal_check_text_changed(NormalState *s)
}
}
+static void normal_check_buffer_modified(NormalState *s)
+{
+ // Trigger BufModified if b_modified changed
+ if (!finish_op && has_event(EVENT_BUFMODIFIEDSET)
+ && curbuf->b_changed_invalid == true) {
+ apply_autocmds(EVENT_BUFMODIFIEDSET, NULL, NULL, false, curbuf);
+ curbuf->b_changed_invalid = false;
+ }
+}
+
static void normal_check_folds(NormalState *s)
{
// Include a closed fold completely in the Visual area.
@@ -1336,6 +1346,7 @@ static int normal_check(VimState *state)
normal_check_cursor_moved(s);
normal_check_text_changed(s);
normal_check_window_scrolled(s);
+ normal_check_buffer_modified(s);
// Updating diffs from changed() does not always work properly,
// esp. updating folds. Do an update just before redrawing if