From 4f9311b759fff0371433fb5b5355fccb001d54e7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 28 Sep 2024 10:21:06 +0800 Subject: fix(window): making float with title/footer non-float leaks memory (#30551) --- src/nvim/api/win_config.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/nvim/api') diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index b006f86a76..f63fdc5381 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -448,7 +448,7 @@ void nvim_win_set_config(Window window, Dict(win_config) *config, Error *err) } } } - win->w_config = fconfig; + merge_win_config(&win->w_config, fconfig); // If there's no "vertical" or "split" set, or if "split" is unchanged, // then we can just change the size of the window. @@ -1312,12 +1312,7 @@ static bool parse_win_config(win_T *wp, Dict(win_config) *config, WinConfig *fco return true; fail: - if (wp == NULL || fconfig->title_chunks.items != wp->w_config.title_chunks.items) { - clear_virttext(&fconfig->title_chunks); - } - if (wp == NULL || fconfig->footer_chunks.items != wp->w_config.footer_chunks.items) { - clear_virttext(&fconfig->footer_chunks); - } + merge_win_config(fconfig, wp != NULL ? wp->w_config : WIN_CONFIG_INIT); return false; #undef HAS_KEY_X } -- cgit