aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMunif Tanjim <hello@muniftanjim.dev>2023-04-02 23:01:10 +0600
committerMunif Tanjim <hello@muniftanjim.dev>2023-04-10 16:26:42 +0600
commitda979ae04b7a8c56586ed0233957600ad6af99f0 (patch)
treecbd4e93374b0161198028d9dd97310e52bcd537b /src
parent53f36806f1b5107c0570ffbf57180a8e08f45b2e (diff)
downloadrneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.tar.gz
rneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.tar.bz2
rneovim-da979ae04b7a8c56586ed0233957600ad6af99f0.zip
fix(api): do not re-apply win_config.style when missing
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/win_config.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 0ffeac1bff..b2b2b51005 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -108,8 +108,8 @@
/// The default value for floats are 50. In general, values below 100 are
/// recommended, unless there is a good reason to overshadow builtin
/// elements.
-/// - style: Configure the appearance of the window. Currently only takes
-/// one non-empty value:
+/// - style: (optional) Configure the appearance of the window. Currently
+/// only supports one value:
/// - "minimal" Nvim will display the window with many UI options
/// disabled. This is useful when displaying a temporary
/// float where the text should not be edited. Disables
@@ -222,9 +222,11 @@ void nvim_win_set_config(Window window, Dict(float_config) *config, Error *err)
win_config_float(win, fconfig);
win->w_pos_changed = true;
}
- if (fconfig.style == kWinStyleMinimal) {
- win_set_minimal_style(win);
- didset_window_options(win, true);
+ if (HAS_KEY(config->style)) {
+ if (fconfig.style == kWinStyleMinimal) {
+ win_set_minimal_style(win);
+ didset_window_options(win, true);
+ }
}
}