mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
vim-patch:9.1.0088: TextChanged not triggered for :norm! commands (#27405)
Problem: TextChanged not triggered for :norm! commands
(machakann, after v9.0.2031)
Solution: Only reset curbuf->b_last_changedtick if TextChangedI
was triggered in insert mode (and not blocked)
Note: for unknown reasons, the test fails on Windows (but seems to work
fine when running interactively)
fixes: vim/vim#13967
closes: vim/vim#13984
c9e79e5284
Cherry-pick test_autocmd.vim change from patch 8.2.4149.
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -363,7 +363,13 @@ static void insert_enter(InsertState *s)
|
||||
ins_apply_autocmds(EVENT_INSERTLEAVE);
|
||||
}
|
||||
did_cursorhold = false;
|
||||
curbuf->b_last_changedtick = buf_get_changedtick(curbuf);
|
||||
|
||||
// ins_redraw() triggers TextChangedI only when no characters
|
||||
// are in the typeahead buffer, so only reset curbuf->b_last_changedtick
|
||||
// if the TextChangedI was not blocked by char_avail() (e.g. using :norm!)
|
||||
if (!char_avail()) {
|
||||
curbuf->b_last_changedtick = buf_get_changedtick(curbuf);
|
||||
}
|
||||
}
|
||||
|
||||
static int insert_check(VimState *state)
|
||||
|
Reference in New Issue
Block a user