mirror of
https://github.com/neovim/neovim.git
synced 2026-03-30 20:32:08 +00:00
fix(api): style=minimal not applied immediately for unmoved split
Problem: nvim_win_set_config with style="minimal" does not take immediate effect when a split is not moved. Solution: don't skip nvim_win_set_config's epilogue when only a resize may be needed. De-duplicate resize logic and remove unnecessary redraw. (win_set*_win already handles that)
This commit is contained in:
@@ -475,14 +475,7 @@ void nvim_win_set_config(Window window, Dict(win_config) *config, Error *err)
|
||||
// then we can just change the size of the window.
|
||||
if ((!has_vertical && !has_split)
|
||||
|| (was_split && !HAS_KEY_X(config, win) && old_split == fconfig.split)) {
|
||||
if (HAS_KEY_X(config, width)) {
|
||||
win_setwidth_win(fconfig.width, win);
|
||||
}
|
||||
if (HAS_KEY_X(config, height)) {
|
||||
win_setheight_win(fconfig.height, win);
|
||||
}
|
||||
redraw_later(win, UPD_NOT_VALID);
|
||||
return;
|
||||
goto resize_split;
|
||||
}
|
||||
|
||||
if (!check_split_disallowed_err(win, err)) {
|
||||
@@ -643,6 +636,7 @@ restore_curwin:
|
||||
win_tp->tp_curwin = altwin;
|
||||
}
|
||||
|
||||
resize_split:
|
||||
if (HAS_KEY_X(config, width)) {
|
||||
win_setwidth_win(fconfig.width, win);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user