1
0
forked from aniani/vim

patch 8.0.1515: BufWinEnter event fired when opening hidden terminal

Problem:    BufWinEnter event fired when opening hidden terminal.
Solution:   Do not fire BufWinEnter when the terminal is midden and does not
            open a window. (Kenta Sato, closes #2636)
This commit is contained in:
Bram Moolenaar
2018-02-13 14:07:18 +01:00
parent 07ad816525
commit ab5e7c3deb
2 changed files with 8 additions and 3 deletions

View File

@@ -475,9 +475,12 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
#ifdef FEAT_AUTOCMD
++curbuf->b_locked;
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
--curbuf->b_locked;
if (!opt->jo_hidden)
{
++curbuf->b_locked;
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
--curbuf->b_locked;
}
#endif
if (old_curbuf != NULL)