Skip to content

Commit 8d5b0b5

Browse files
committed
feat(popup): support 'default' border style
1 parent 118a12f commit 8d5b0b5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lua/nui/popup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Controls the styling of the border.
9494

9595
**Examples**
9696

97-
Can be one of the pre-defined styles: `"double"`, `"none"`, `"rounded"`, `"shadow"`, `"single"` or `"solid"`.
97+
Can be one of the pre-defined styles: `"double"`, `"none"`, `"rounded"`, `"shadow"`, `"single"`, `"solid"` or `"default"`.
9898

9999
```lua
100100
border = {

lua/nui/popup/border.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ end
416416

417417
---@alias _nui_popup_border_style_char_tuple table<1|2, string>
418418
---@alias _nui_popup_border_style_char string|_nui_popup_border_style_char_tuple|NuiText
419-
---@alias _nui_popup_border_style_builtin 'double'|'none'|'rounded'|'shadow'|'single'|'solid'
419+
---@alias _nui_popup_border_style_builtin 'double'|'none'|'rounded'|'shadow'|'single'|'solid'|'default'
420420
---@alias _nui_popup_border_style_list table<1|2|3|4|5|6|7|8, _nui_popup_border_style_char>
421421
---@alias _nui_popup_border_style_map_position 'top_left'|'top'|'top_right'|'right'|'bottom_right'|'bottom'|'bottom_left'|'left'
422422
---@alias _nui_popup_border_style_map table<_nui_popup_border_style_map_position, _nui_popup_border_style_char>
@@ -677,6 +677,13 @@ end
677677
function Border:set_style(style)
678678
local internal = self._
679679

680+
if style == "default" then
681+
style = _.get_default_winborder()
682+
if style == "none" and internal.type == "complex" then
683+
style = "single"
684+
end
685+
end
686+
680687
internal.style = style
681688

682689
local char = prepare_char_map(internal.style, internal.char)

0 commit comments

Comments
 (0)