feat(option): custom chars in 'winborder' #33772

Problem: winborder option only supported predefined styles and lacked support for custom border characters.

Solution: implement parsing for comma-separated list format that allows specifying 8 individual border characters (topleft, top, topright, right, botright, bottom, botleft, left).
This commit is contained in:
glepnir
2025-07-10 09:15:08 +08:00
committed by GitHub
parent 7526fb449d
commit fb0dc825e9
8 changed files with 100 additions and 12 deletions

View File

@ -229,7 +229,7 @@ OPTIONS
• 'diffopt' `inline:` configures diff highlighting for changes within a line.
• 'grepformat' is now a |global-local| option.
• 'pummaxwidth' sets maximum width for the completion popup menu.
• 'winborder' "bold" style.
• 'winborder' "bold" style, custom border style.
• |g:clipboard| accepts a string name to force any builtin clipboard tool.
• 'busy' sets a buffer "busy" status. Indicated in the default statusline.

View File

@ -7410,6 +7410,10 @@ A jump table for the options with a short description can be found at |Q_op|.
- "shadow": Drop shadow effect, by blending with the background.
- "single": Single-line box.
- "solid": Adds padding by a single whitespace cell.
- custom: comma-separated list of exactly 8 characters in clockwise
order starting from topleft. Example: >lua
vim.o.winborder='+,-,+,|,+,-,+,|'
<
*'window'* *'wi'*
'window' 'wi' number (default screen height - 1)

View File

@ -8117,8 +8117,15 @@ vim.wo.winbl = vim.wo.winblend
--- - "shadow": Drop shadow effect, by blending with the background.
--- - "single": Single-line box.
--- - "solid": Adds padding by a single whitespace cell.
--- - custom: comma-separated list of exactly 8 characters in clockwise
--- order starting from topleft. Example:
---
--- @type ''|'double'|'single'|'shadow'|'rounded'|'solid'|'bold'|'none'
--- ```lua
--- vim.o.winborder='+,-,+,`,+,-,+,`'
--- ```
---
---
--- @type string
vim.o.winborder = ""
vim.go.winborder = vim.o.winborder