diff options
author | Famiu Haque <famiuhaque@proton.me> | 2023-12-07 01:34:29 +0600 |
---|---|---|
committer | Famiu Haque <famiuhaque@proton.me> | 2023-12-14 16:46:42 +0600 |
commit | 3c2c022e5e299ecac4663c3813e2db5e2b099ffa (patch) | |
tree | 8cfefb87b8a675e1c29b0caf3e1adca14bf196b5 /test/functional/api/vim_spec.lua | |
parent | 320e9c1c21817fd76b84345018661f70437fa4b5 (diff) | |
download | rneovim-3c2c022e5e299ecac4663c3813e2db5e2b099ffa.tar.gz rneovim-3c2c022e5e299ecac4663c3813e2db5e2b099ffa.tar.bz2 rneovim-3c2c022e5e299ecac4663c3813e2db5e2b099ffa.zip |
refactor(options): remove option type macros
Problem: We have `P_(BOOL|NUM|STRING)` macros to represent an option's type, which is redundant because `OptValType` can already do that. The current implementation of option type flags is also too limited to allow adding multitype options in the future.
Solution: Remove `P_(BOOL|NUM|STRING)` and replace it with a new `type_flags` attribute in `vimoption_T`. Also do some groundwork for adding multitype options in the future.
Side-effects: Attempting to set an invalid keycode option (e.g. `set t_foo=123`) no longer gives an error.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 3d3b478d66..104ffd7d6c 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1478,9 +1478,9 @@ describe('API', function() pcall_err(nvim, 'get_option_value', 'scrolloff', {scope = 42})) 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", + eq("Invalid value for option 'scrolloff': expected number, got boolean true", pcall_err(nvim, 'set_option_value', 'scrolloff', true, {})) - eq("Invalid value for option 'scrolloff': expected Number, got String \"wrong\"", + eq("Invalid value for option 'scrolloff': expected number, got string \"wrong\"", pcall_err(nvim, 'set_option_value', 'scrolloff', 'wrong', {})) end) |