aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-01 05:39:52 +0800
committerGitHub <noreply@github.com>2024-04-01 05:39:52 +0800
commite005b8d2eb0d5967d46cae604e3fac0ccae37555 (patch)
tree24e20506eb14131e6fad6a36b9b31469bb741813 /src/nvim/edit.c
parent9b9dab622a89a620419f4e0682d235bd30d705db (diff)
downloadrneovim-e005b8d2eb0d5967d46cae604e3fac0ccae37555.tar.gz
rneovim-e005b8d2eb0d5967d46cae604e3fac0ccae37555.tar.bz2
rneovim-e005b8d2eb0d5967d46cae604e3fac0ccae37555.zip
vim-patch:9.1.0230: TextChanged autocommand not triggered under some circumstances (#28135)
Problem: TextChanged autocommand not triggered under some circumstances (Sergey Vlasov) Solution: Trigger TextChanged when TextChangedI has not been triggered fixes: vim/vim#14332 closes: vim/vim#14339 https://github.com/vim/vim/commit/86032702932995db74fed265ba99ae0c823cb75d Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 8b8345657c..0326096486 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -365,9 +365,10 @@ static void insert_enter(InsertState *s)
did_cursorhold = false;
// ins_redraw() triggers TextChangedI only when no characters
- // are in the typeahead buffer, so only reset curbuf->b_last_changedtick
+ // are in the typeahead buffer, so reset curbuf->b_last_changedtick
// if the TextChangedI was not blocked by char_avail() (e.g. using :norm!)
- if (!char_avail()) {
+ // and the TextChangedI autocommand has been triggered
+ if (!char_avail() && curbuf->b_last_changedtick_i == buf_get_changedtick(curbuf)) {
curbuf->b_last_changedtick = buf_get_changedtick(curbuf);
}
}