aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 1f2403450f..93bbdd3be9 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -5724,6 +5724,8 @@ static void n_opencmd(cmdarg_T *cap)
(void)hasFolding(curwin->w_cursor.lnum,
NULL, &curwin->w_cursor.lnum);
}
+ // trigger TextChangedI for the 'o/O' command
+ curbuf->b_last_changedtick_i = buf_get_changedtick(curbuf);
if (u_save(curwin->w_cursor.lnum - (cap->cmdchar == 'O' ? 1 : 0),
curwin->w_cursor.lnum + (cap->cmdchar == 'o' ? 1 : 0))
&& open_line(cap->cmdchar == 'O' ? BACKWARD : FORWARD,
@@ -6265,6 +6267,11 @@ static void invoke_edit(cmdarg_T *cap, int repl, int cmd, int startln)
// Always reset "restart_edit", this is not a restarted edit.
restart_edit = 0;
+ // Reset Changedtick_i, so that TextChangedI will only be triggered for stuff
+ // from insert mode, for 'o/O' this has already been done in n_opencmd
+ if (cap->cmdchar != 'O' && cap->cmdchar != 'o') {
+ curbuf->b_last_changedtick_i = buf_get_changedtick(curbuf);
+ }
if (edit(cmd, startln, cap->count1)) {
cap->retval |= CA_COMMAND_BUSY;
}