0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.2075: TextChangedI may not always trigger

Problem:  TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
          append/change operations, and when
          opening a new line,

fixes: #13367
closes: #13375

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
This commit is contained in:
Christian Brabandt
2023-10-27 19:26:49 +02:00
parent daef8c7437
commit 4bca4897a1
5 changed files with 41 additions and 12 deletions

View File

@@ -4134,6 +4134,9 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
// before.
restore_lbr(lbr_saved);
#endif
// trigger TextChangedI
curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
if (op_change(oap)) // will call edit()
cap->retval |= CA_COMMAND_BUSY;
if (restart_edit == 0)
@@ -4244,6 +4247,9 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
// before.
restore_lbr(lbr_saved);
#endif
// trigger TextChangedI
curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
op_insert(oap, cap->count1);
#ifdef FEAT_LINEBREAK
// Reset linebreak, so that formatting works correctly.