diff options
| author | Juan Pablo Briones <jpbrione@gmail.com> | 2026-03-18 20:19:47 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-18 19:19:47 -0400 |
| commit | f4f1149292aa0d085e312d3fd2138b5c2c1fb67d (patch) | |
| tree | c1ca4da56da6c9c052b09f6dae5f5d1b02835dbe /test/functional/lua | |
| parent | 8f9278d7c2586f10d6275d79132f979a49afec46 (diff) | |
fix(options): vim.opt fails for 'fillchars' #37141
Problem:
When `to_vim_value[info.metatype](info, value)` is called, a list value
such as `{'eob:a'}` is treated like a map, which generates `1:eob:a`.
Note: commands like `:lua vim.opt.wildmode={'longest:full'}` are not an
issue because only cases harcoded in `key_value_options` have metatype `map`.
Solution:
Check for array type and use the same logic as in array metatypes.
Diffstat (limited to 'test/functional/lua')
| -rw-r--r-- | test/functional/lua/option_and_var_spec.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/lua/option_and_var_spec.lua b/test/functional/lua/option_and_var_spec.lua index eac74a5cc5..f4f54a4f30 100644 --- a/test/functional/lua/option_and_var_spec.lua +++ b/test/functional/lua/option_and_var_spec.lua @@ -778,7 +778,7 @@ describe('lua stdlib', function() eq(true, not formatoptions.q) end) - it('works for array list type options', function() + it('works for comma list type options', function() local wildignore = exec_lua(function() vim.opt.wildignore = '*.c,*.o,__pycache__' return vim.opt.wildignore:get() @@ -788,6 +788,13 @@ describe('lua stdlib', function() eq('*.c', wildignore[1]) end) + it('works for array list type options', function() + eq_exec_lua({ eol = '~', space = '-' }, function() + vim.opt.listchars = { 'eol:~', 'space:-' } + return vim.opt.listchars:get() + end) + end) + it('works for options that are both commalist and flaglist', function() eq_exec_lua({ b = true, s = true }, function() vim.opt.whichwrap = 'b,s' |
