Mercurial > vim
comparison src/ops.c @ 33676:46cd1fc257de v9.0.2075
patch 9.0.2075: TextChangedI may not always trigger
Commit: https://github.com/vim/vim/commit/4bca4897a12dfb91b3b27e3083fd5f370bd857d1
Author: Christian Brabandt <cb@256bit.org>
Date: Fri Oct 27 19:26:49 2023 +0200
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 27 Oct 2023 19:45:04 +0200 |
parents | 6eac4f616293 |
children | 872c07d5befe |
comparison
equal
deleted
inserted
replaced
33675:b562d3f78dd5 | 33676:46cd1fc257de |
---|---|
4132 #ifdef FEAT_LINEBREAK | 4132 #ifdef FEAT_LINEBREAK |
4133 // Restore linebreak, so that when the user edits it looks as | 4133 // Restore linebreak, so that when the user edits it looks as |
4134 // before. | 4134 // before. |
4135 restore_lbr(lbr_saved); | 4135 restore_lbr(lbr_saved); |
4136 #endif | 4136 #endif |
4137 // trigger TextChangedI | |
4138 curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf); | |
4139 | |
4137 if (op_change(oap)) // will call edit() | 4140 if (op_change(oap)) // will call edit() |
4138 cap->retval |= CA_COMMAND_BUSY; | 4141 cap->retval |= CA_COMMAND_BUSY; |
4139 if (restart_edit == 0) | 4142 if (restart_edit == 0) |
4140 restart_edit = restart_edit_save; | 4143 restart_edit = restart_edit_save; |
4141 } | 4144 } |
4242 #ifdef FEAT_LINEBREAK | 4245 #ifdef FEAT_LINEBREAK |
4243 // Restore linebreak, so that when the user edits it looks as | 4246 // Restore linebreak, so that when the user edits it looks as |
4244 // before. | 4247 // before. |
4245 restore_lbr(lbr_saved); | 4248 restore_lbr(lbr_saved); |
4246 #endif | 4249 #endif |
4250 // trigger TextChangedI | |
4251 curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf); | |
4252 | |
4247 op_insert(oap, cap->count1); | 4253 op_insert(oap, cap->count1); |
4248 #ifdef FEAT_LINEBREAK | 4254 #ifdef FEAT_LINEBREAK |
4249 // Reset linebreak, so that formatting works correctly. | 4255 // Reset linebreak, so that formatting works correctly. |
4250 (void)reset_lbr(); | 4256 (void)reset_lbr(); |
4251 #endif | 4257 #endif |