diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-09-28 10:21:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 10:21:06 +0800 |
commit | 4f9311b759fff0371433fb5b5355fccb001d54e7 (patch) | |
tree | 616920f079d5be9b7ac0c2e07fda93eb8913654c /src/nvim/api | |
parent | 0f067cd34d09b38f9aaf2e1732d825e89b573077 (diff) | |
download | rneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.tar.gz rneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.tar.bz2 rneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.zip |
fix(window): making float with title/footer non-float leaks memory (#30551)
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/win_config.c | 9 |
1 files changed, 2 insertions, 7 deletions
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 } |