mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 06:10:39 +00:00
fix(option): allow empty/blank edges in 'winborder' #40112
Problem: The comma form of 'winborder' is split with copy_option_part(), whose skip_to_option_part() eats spaces after a comma, and empty fields are rejected. Solution: Split the comma form literally on ',', keeping empty fields and single-space fields.
This commit is contained in:
@@ -11478,8 +11478,18 @@ describe('float window', function()
|
||||
winid = api.nvim_open_win(buf, false, config)
|
||||
eq('●', api.nvim_win_get_config(winid).border[1])
|
||||
|
||||
-- Single-space border char.
|
||||
command([[lua vim.opt.winborder=",,, ,,,, "]])
|
||||
winid = api.nvim_open_win(buf, false, config)
|
||||
eq({ '', '', '', ' ', '', '', '', ' ' }, api.nvim_win_get_config(winid).border)
|
||||
|
||||
-- Trailing comma hides the last side
|
||||
command([[set winborder=+,-,+,\|,+,-,+,]])
|
||||
winid = api.nvim_open_win(buf, false, config)
|
||||
eq({ '+', '-', '+', '|', '+', '-', '+', '' }, api.nvim_win_get_config(winid).border)
|
||||
command('fclose!')
|
||||
|
||||
eq('Vim(set):E474: Invalid argument: winborder=,,', pcall_err(command, 'set winborder=,,'))
|
||||
eq('Vim(set):E474: Invalid argument: winborder=+,-,+,|,+,-,+,', pcall_err(command, [[set winborder=+,-,+,\|,+,-,+,]]))
|
||||
eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user