diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
commit | c324271b99eee4c621463f368914d57cd729bd9c (patch) | |
tree | 5d979d333a2d5f9c080991d5482fd5916f8579c6 /test/functional/plugin/vim_syntax_spec.lua | |
parent | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.gz rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.bz2 rneovim-c324271b99eee4c621463f368914d57cd729bd9c.zip |
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'test/functional/plugin/vim_syntax_spec.lua')
-rw-r--r-- | test/functional/plugin/vim_syntax_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/plugin/vim_syntax_spec.lua b/test/functional/plugin/vim_syntax_spec.lua new file mode 100644 index 0000000000..9396bbce5c --- /dev/null +++ b/test/functional/plugin/vim_syntax_spec.lua @@ -0,0 +1,40 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local exec = helpers.exec +local api = helpers.api + +describe('Vimscript syntax highlighting', function() + local screen + + before_each(function() + clear() + helpers.add_builddir_to_rtp() + exec([[ + setfiletype vim + syntax on + ]]) + screen = Screen.new() + screen:set_default_attr_ids({ + [0] = { foreground = Screen.colors.Blue, bold = true }, + [1] = { foreground = Screen.colors.Brown, bold = true }, + [2] = { foreground = tonumber('0x6a0dad') }, + }) + screen:attach() + end) + + it('prefixed boolean options are highlighted properly', function() + api.nvim_buf_set_lines(0, 0, -1, true, { + 'set number incsearch hlsearch', + 'set nonumber noincsearch nohlsearch', + 'set invnumber invincsearch invhlsearch', + }) + screen:expect([[ + {1:^set} {2:number} {2:incsearch} {2:hlsearch} | + {1:set} {2:nonumber} {2:noincsearch} {2:nohlsearch} | + {1:set} {2:invnumber} {2:invincsearch} {2:invhlsearch} | + {0:~ }|*10 + | + ]]) + end) +end) |