vim-patch:8.0.1494: no autocmd triggered in Insert mode with visible popup menu

Problem:    No autocmd triggered in Insert mode with visible popup menu.
Solution:   Add TextChangedP. (Prabir Shrestha, Christian Brabandt,
            closes vim/vim#2372, closes vim/vim#1691)
            Fix that the TextChanged autocommands are not always triggered
            when sourcing a script.

5a09343719
This commit is contained in:
Shougo Matsushita
2018-02-11 22:37:14 +09:00
committed by chemzqm
parent 36b2e3f743
commit 021c5875c1
9 changed files with 178 additions and 18 deletions

View File

@@ -1387,13 +1387,20 @@ ins_redraw (
// Trigger TextChangedI if b_changedtick differs.
if (ready && has_event(EVENT_TEXTCHANGEDI)
&& last_changedtick != curbuf->b_changedtick
&& curbuf->b_last_changedtick != curbuf->b_changedtick
&& !pum_visible()) {
if (last_changedtick_buf == curbuf) {
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, false, curbuf);
}
last_changedtick_buf = curbuf;
last_changedtick = curbuf->b_changedtick;
curbuf->b_last_changedtick = curbuf->b_changedtick;
}
// 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.
if (ready && has_event(EVENT_TEXTCHANGEDP)
&& curbuf->b_last_changedtick_pum != curbuf->b_changedtick
&& pum_visible()) {
apply_autocmds(EVENT_TEXTCHANGEDP, NULL, NULL, false, curbuf);
curbuf->b_last_changedtick_pum = curbuf->b_changedtick;
}
if (must_redraw)
@@ -1415,6 +1422,7 @@ ins_redraw (
emsg_on_display = FALSE; /* may remove error message now */
}
/*
* Handle a CTRL-V or CTRL-Q typed in Insert mode.
*/