fix(float): trigger winnew event when float window create

This commit is contained in:
glepnir
2023-09-11 19:46:15 +08:00
parent 71530cc972
commit 437ed3cee2
2 changed files with 26 additions and 0 deletions

View File

@@ -195,6 +195,9 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dict(float_config) *config, E
if (win_valid(wp) && buffer > 0) {
Boolean noautocmd = !enter || fconfig.noautocmd;
win_set_buf(wp, buf, noautocmd, err);
if (!fconfig.noautocmd) {
apply_autocmds(EVENT_WINNEW, NULL, NULL, false, buf);
}
}
if (!win_valid(wp)) {
api_set_error(err, kErrorTypeException, "Window was closed immediately");