diff options
Diffstat (limited to 'src/nvim/api/win_config.c')
-rw-r--r-- | src/nvim/api/win_config.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index 12bbd79dbd..31de5ca1eb 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -159,17 +159,11 @@ /// 'fillchars' to a space char, and clearing the /// |hl-EndOfBuffer| region in 'winhighlight'. /// - border: Style of (optional) window border. This can either be a string -/// or an array. The string values are -/// - "none": No border (default). -/// - "single": A single line box. -/// - "double": A double line box. -/// - "rounded": Like "single", but with rounded corners ("╭" etc.). -/// - "solid": Adds padding by a single whitespace cell. -/// - "shadow": A drop shadow effect by blending with the background. -/// - If it is an array, it should have a length of eight or any divisor of -/// eight. The array will specify the eight chars building up the border -/// in a clockwise fashion starting with the top-left corner. As an -/// example, the double box style could be specified as: +/// or an array. The string values are the same as those described in 'winborder'. +/// If it is an array, it should have a length of eight or any divisor of +/// eight. The array will specify the eight chars building up the border +/// in a clockwise fashion starting with the top-left corner. As an +/// example, the double box style could be specified as: /// ``` /// [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ]. /// ``` @@ -944,11 +938,11 @@ static void parse_border_style(Object style, WinConfig *fconfig, Error *err) char chars[8][MAX_SCHAR_SIZE]; bool shadow_color; } defaults[] = { - { "double", { "╔", "═", "╗", "║", "╝", "═", "╚", "║" }, false }, - { "single", { "┌", "─", "┐", "│", "┘", "─", "└", "│" }, false }, - { "shadow", { "", "", " ", " ", " ", " ", " ", "" }, true }, - { "rounded", { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, false }, - { "solid", { " ", " ", " ", " ", " ", " ", " ", " " }, false }, + { opt_winborder_values[1], { "╔", "═", "╗", "║", "╝", "═", "╚", "║" }, false }, + { opt_winborder_values[2], { "┌", "─", "┐", "│", "┘", "─", "└", "│" }, false }, + { opt_winborder_values[3], { "", "", " ", " ", " ", " ", " ", "" }, true }, + { opt_winborder_values[4], { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, false }, + { opt_winborder_values[5], { " ", " ", " ", " ", " ", " ", " ", " " }, false }, { NULL, { { NUL } }, false }, }; @@ -1279,12 +1273,13 @@ static bool parse_win_config(win_T *wp, Dict(win_config) *config, WinConfig *fco } } - if (HAS_KEY_X(config, border)) { + if (HAS_KEY_X(config, border) || *p_winbd != NUL) { if (is_split) { api_set_error(err, kErrorTypeValidation, "non-float cannot have 'border'"); goto fail; } - parse_border_style(config->border, fconfig, err); + Object style = config->border.type != kObjectTypeNil ? config->border : CSTR_AS_OBJ(p_winbd); + parse_border_style(style, fconfig, err); if (ERROR_SET(err)) { goto fail; } |