vim-patch:8.2.0429: no warning when test checks for option that never exists

Problem:    No warning when test checks for option that never exists.
Solution:   In tests check that the option can exist.
c5a8fdc42d
This commit is contained in:
Jan Edmund Lazo 2020-12-28 18:11:51 -05:00
parent 26dfeb42dd
commit d712c30fff
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -12,6 +12,9 @@ endfunc
" Command to check for the presence of a working option. " Command to check for the presence of a working option.
command -nargs=1 CheckOption call CheckOption(<f-args>) command -nargs=1 CheckOption call CheckOption(<f-args>)
func CheckOption(name) func CheckOption(name)
if !exists('&' .. a:name)
throw 'Checking for non-existent option ' .. a:name
endif
if !exists('+' .. a:name) if !exists('+' .. a:name)
throw 'Skipped: ' .. a:name .. ' option not supported' throw 'Skipped: ' .. a:name .. ' option not supported'
endif endif