refactor(options): get_option_value_strict() and SREQ_*

`SREQ_*` values are now actual typedef'd enums. `get_option_value_strict()` has also been refactored and split into two functions, `get_option_attrs()` for getting the option attributes, and `get_option_value_strict()` for getting the actual value. Moreover, it now returns an `OptVal`. Other miscellaneous refactors have also been made.
This commit is contained in:
Famiu Haque
2023-10-19 20:09:02 +06:00
committed by Lewis Russell
parent f4b896198f
commit 6c87d3e0fb
5 changed files with 268 additions and 299 deletions

View File

@@ -1493,7 +1493,7 @@ describe('API', function()
pcall_err(nvim, 'set_option_value', 'scrolloff', 1, {scope = 'bogus'}))
eq("Invalid 'scope': expected String, got Integer",
pcall_err(nvim, 'get_option_value', 'scrolloff', {scope = 42}))
eq("Invalid 'value': expected Integer/Boolean/String, got Array",
eq("Invalid 'value': expected valid option type, got Array",
pcall_err(nvim, 'set_option_value', 'scrolloff', {}, {}))
eq("Invalid value for option 'scrolloff': expected Number, got Boolean true",
pcall_err(nvim, 'set_option_value', 'scrolloff', true, {}))