Mercurial > vim
comparison src/edit.c @ 34307:a66a01e2094a v9.1.0088
patch 9.1.0088: TextChanged not triggered for :norm! commands
Commit: https://github.com/vim/vim/commit/c9e79e52845d51f48f5ea3753a62ab3fe0e40184
Author: Christian Brabandt <cb@256bit.org>
Date: Fri Feb 9 19:34:36 2024 +0100
patch 9.1.0088: TextChanged not triggered for :norm! commands
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 09 Feb 2024 19:45:05 +0100 |
parents | a0a4a774117b |
children | 67674e379c26 |
comparison
equal
deleted
inserted
replaced
34306:73ec7fd829a8 | 34307:a66a01e2094a |
---|---|
841 // that the autocommands won't be executed. When mapped got_int | 841 // that the autocommands won't be executed. When mapped got_int |
842 // is not set, but let's keep the behavior the same. | 842 // is not set, but let's keep the behavior the same. |
843 if (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C) | 843 if (cmdchar != 'r' && cmdchar != 'v' && c != Ctrl_C) |
844 ins_apply_autocmds(EVENT_INSERTLEAVE); | 844 ins_apply_autocmds(EVENT_INSERTLEAVE); |
845 did_cursorhold = FALSE; | 845 did_cursorhold = FALSE; |
846 curbuf->b_last_changedtick = CHANGEDTICK(curbuf); | 846 |
847 // ins_redraw() triggers TextChangedI only when no characters | |
848 // are in the typeahead buffer, so only reset curbuf->b_last_changedtick | |
849 // if the TextChangedI was not blocked by char_avail() (e.g. using :norm!) | |
850 if (!char_avail()) | |
851 curbuf->b_last_changedtick = CHANGEDTICK(curbuf); | |
847 return (c == Ctrl_O); | 852 return (c == Ctrl_O); |
848 } | 853 } |
849 continue; | 854 continue; |
850 | 855 |
851 case Ctrl_Z: // suspend when 'insertmode' set | 856 case Ctrl_Z: // suspend when 'insertmode' set |