fix(ui): doesn't trigger au event when enter is false

This commit is contained in:
glepnir
2023-09-10 15:09:20 +08:00
parent 82150ca51b
commit a916523574
2 changed files with 42 additions and 1 deletions

View File

@@ -190,7 +190,8 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dict(float_config) *config, E
}
// autocmds in win_enter or win_set_buf below may close the window
if (win_valid(wp) && buffer > 0) {
win_set_buf(wp, buf, fconfig.noautocmd, err);
Boolean noautocmd = !enter || fconfig.noautocmd;
win_set_buf(wp, buf, noautocmd, err);
}
if (!win_valid(wp)) {
api_set_error(err, kErrorTypeException, "Window was closed immediately");