summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-02-09 19:34:36 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-09 19:34:36 +0100
commitc9e79e52845d51f48f5ea3753a62ab3fe0e40184 (patch)
tree35fe3e9e359b9ca62a31f6048d4e35b4a1e76858 /src/edit.c
parent2975a54f285e5b4bf026c1dc706b5d90777d64e7 (diff)
patch 9.1.0088: TextChanged not triggered for :norm! commandsv9.1.0088
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: #13967 closes: #13984 Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c
index e9a994f6b2..5760b06e86 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -843,7 +843,12 @@ doESCkey:
if (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C)
ins_apply_autocmds(EVENT_INSERTLEAVE);
did_cursorhold = FALSE;
- curbuf->b_last_changedtick = 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 = CHANGEDTICK(curbuf);
return (c == Ctrl_O);
}
continue;