mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.3517: TextChanged does not trigger after TextChangedI
Problem: TextChanged does not trigger after TextChangedI. Solution: Store the tick separately for TextChangedI. (Christian Brabandt, closes #8968, closes #8932)
This commit is contained in:
committed by
Bram Moolenaar
parent
7b5f45be21
commit
db3b44640d
12
src/edit.c
12
src/edit.c
@@ -1477,9 +1477,9 @@ ins_redraw(int ready) // not busy with something
|
||||
last_cursormoved = curwin->w_cursor;
|
||||
}
|
||||
|
||||
// Trigger TextChangedI if b_changedtick differs.
|
||||
// Trigger TextChangedI if b_changedtick_i differs.
|
||||
if (ready && has_textchangedI()
|
||||
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf)
|
||||
&& curbuf->b_last_changedtick_i != CHANGEDTICK(curbuf)
|
||||
&& !pum_visible())
|
||||
{
|
||||
aco_save_T aco;
|
||||
@@ -1489,15 +1489,15 @@ ins_redraw(int ready) // not busy with something
|
||||
aucmd_prepbuf(&aco, curbuf);
|
||||
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
|
||||
aucmd_restbuf(&aco);
|
||||
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
|
||||
curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
|
||||
if (tick != CHANGEDTICK(curbuf)) // see ins_apply_autocmds()
|
||||
u_save(curwin->w_cursor.lnum,
|
||||
(linenr_T)(curwin->w_cursor.lnum + 1));
|
||||
}
|
||||
|
||||
// Trigger TextChangedP if b_changedtick differs. When the popupmenu closes
|
||||
// TextChangedI will need to trigger for backwards compatibility, thus use
|
||||
// different b_last_changedtick* variables.
|
||||
// Trigger TextChangedP if b_changedtick_pum differs. When the popupmenu
|
||||
// closes TextChangedI will need to trigger for backwards compatibility,
|
||||
// thus use different b_last_changedtick* variables.
|
||||
if (ready && has_textchangedP()
|
||||
&& curbuf->b_last_changedtick_pum != CHANGEDTICK(curbuf)
|
||||
&& pum_visible())
|
||||
|
Reference in New Issue
Block a user