diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-01-07 08:20:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-07 08:20:37 -0700 |
commit | 363633844903331ae1d6383de2fef329db08b5e3 (patch) | |
tree | 6f6ab3d711c26a8d91c7bf51ddc16027cec9d7b0 /test/functional | |
parent | 42afa0369a3c01dddd1efef1397bbf46011f391b (diff) | |
parent | 6ffa434f0b1c6e82fb6c1445d5d7382e0ef22e07 (diff) | |
download | rneovim-363633844903331ae1d6383de2fef329db08b5e3.tar.gz rneovim-363633844903331ae1d6383de2fef329db08b5e3.tar.bz2 rneovim-363633844903331ae1d6383de2fef329db08b5e3.zip |
Merge pull request #21649 from gpanders/editorconfig-enable
feat(editorconfig): allow editorconfig to be toggled dynamically
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/plugin/editorconfig_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/plugin/editorconfig_spec.lua b/test/functional/plugin/editorconfig_spec.lua index f71b8088ed..e6a2550aba 100644 --- a/test/functional/plugin/editorconfig_spec.lua +++ b/test/functional/plugin/editorconfig_spec.lua @@ -4,6 +4,8 @@ local command = helpers.command local eq = helpers.eq local pathsep = helpers.get_pathsep() local curbufmeths = helpers.curbufmeths +local funcs = helpers.funcs +local meths = helpers.meths local testdir = 'Xtest-editorconfig' @@ -191,4 +193,18 @@ But not this one it('sets textwidth', function() test_case('max_line_length.txt', { textwidth = 42 }) end) + + it('can be disabled globally', function() + meths.set_var('editorconfig', false) + meths.set_option_value('shiftwidth', 42, {}) + test_case('3_space.txt', { shiftwidth = 42 }) + end) + + it('can be disabled per-buffer', function() + meths.set_option_value('shiftwidth', 42, {}) + local bufnr = funcs.bufadd(testdir .. pathsep .. '3_space.txt') + meths.buf_set_var(bufnr, 'editorconfig', false) + test_case('3_space.txt', { shiftwidth = 42 }) + test_case('4_space.py', { shiftwidth = 4 }) + end) end) |