Skip to content

Commit ab5e7c3

Browse files
committed
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)
1 parent 07ad816 commit ab5e7c3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/terminal.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,12 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
475475
channel_set_nonblock(term->tl_job->jv_channel, PART_IN);
476476

477477
#ifdef FEAT_AUTOCMD
478-
++curbuf->b_locked;
479-
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
480-
--curbuf->b_locked;
478+
if (!opt->jo_hidden)
479+
{
480+
++curbuf->b_locked;
481+
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
482+
--curbuf->b_locked;
483+
}
481484
#endif
482485

483486
if (old_curbuf != NULL)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1515,
774776
/**/
775777
1514,
776778
/**/

0 commit comments

Comments
 (0)