refactor(options): 'previewpopup' validation

Use a schema instead of manual parsing.
This commit is contained in:
Justin M. Keyes
2026-07-23 23:48:57 +02:00
parent 3fceb84560
commit e8195baaef
4 changed files with 54 additions and 46 deletions

View File

@@ -6846,10 +6846,17 @@ local options = {
{
abbreviation = 'pvp',
cb = 'did_set_previewpopup',
values = {
'height:',
'width:',
'border:',
schema = {
dict = {
{ 'height', 'num' },
{ 'width', 'num' },
-- Only the named 'winborder' styles; a custom (comma) border can't be given here.
{
'border',
'enum',
{ values = { 'double', 'single', 'shadow', 'rounded', 'solid', 'bold', 'none' } },
},
},
},
expand_cb = 'expand_set_popupoption',
defaults = { if_true = '' },