mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 03:58:32 +00:00
feat: implement BufModified autocmd
This commit is contained in:
@@ -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_BUFMODIFIED)
|
||||
&& curbuf->b_changed_notified == false) {
|
||||
apply_autocmds(EVENT_BUFMODIFIED, NULL, NULL, false, curbuf);
|
||||
curbuf->b_changed_notified = true;
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user