aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-19 15:28:24 +0800
committerGitHub <noreply@github.com>2025-03-19 07:28:24 +0000
commit63bbb7c109a5db1520148168c40e0e5ce512a41f (patch)
tree4e0536171f0900fae6a23a4f700cd4910f322d54 /src/nvim/api
parent190d0241e2a0cd4ec4bcb520772db835df935530 (diff)
downloadrneovim-63bbb7c109a5db1520148168c40e0e5ce512a41f.tar.gz
rneovim-63bbb7c109a5db1520148168c40e0e5ce512a41f.tar.bz2
rneovim-63bbb7c109a5db1520148168c40e0e5ce512a41f.zip
fix(api): fix 'winborder' preventing splits with nvim_open_win (#32981)
While at it, rename the p_winbd variable to p_winborder, as 'winbd' is not the option's short name. Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/win_config.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 31de5ca1eb..4b5b02e507 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -1273,13 +1273,18 @@ static bool parse_win_config(win_T *wp, Dict(win_config) *config, WinConfig *fco
}
}
- if (HAS_KEY_X(config, border) || *p_winbd != NUL) {
+ Object border_style = OBJECT_INIT;
+ if (HAS_KEY_X(config, border)) {
if (is_split) {
api_set_error(err, kErrorTypeValidation, "non-float cannot have 'border'");
goto fail;
}
- Object style = config->border.type != kObjectTypeNil ? config->border : CSTR_AS_OBJ(p_winbd);
- parse_border_style(style, fconfig, err);
+ border_style = config->border;
+ } else if (*p_winborder != NUL) {
+ border_style = CSTR_AS_OBJ(p_winborder);
+ }
+ if (border_style.type != kObjectTypeNil) {
+ parse_border_style(border_style, fconfig, err);
if (ERROR_SET(err)) {
goto fail;
}