0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.0057: popup menu displayed wrong when using autocmd

Problem:    Popup menu displayed wrong when using autocmd.
Solution:   Use aucmd_prepbuf().  Force updating status line if the popup menu
            is going to be redrawn anyway. (Christian Brabandt, closes #3009)
This commit is contained in:
Bram Moolenaar
2018-06-16 15:32:38 +02:00
parent 43dee181f5
commit 6ba3ec1bac
4 changed files with 24 additions and 10 deletions

View File

@@ -1704,7 +1704,12 @@ ins_redraw(
#endif
)
{
aco_save_T aco;
// save and restore curwin and curbuf, in case the autocmd changes them
aucmd_prepbuf(&aco, curbuf);
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
aucmd_restbuf(&aco);
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
}
@@ -1716,7 +1721,12 @@ ins_redraw(
&& curbuf->b_last_changedtick_pum != CHANGEDTICK(curbuf)
&& pum_visible())
{
aco_save_T aco;
// save and restore curwin and curbuf, in case the autocmd changes them
aucmd_prepbuf(&aco, curbuf);
apply_autocmds(EVENT_TEXTCHANGEDP, NULL, NULL, FALSE, curbuf);
aucmd_restbuf(&aco);
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
}
#endif