diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-05 16:47:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 16:47:43 +0800 |
commit | 43bd9c9c1cacb2f069c7e84330a608623c874d74 (patch) | |
tree | d349204e2fb9470136471cfb3b66b25fbabbd93c /test/functional | |
parent | e41597c510b4708c3192aa7573137e0fe9468a3a (diff) | |
download | rneovim-43bd9c9c1cacb2f069c7e84330a608623c874d74.tar.gz rneovim-43bd9c9c1cacb2f069c7e84330a608623c874d74.tar.bz2 rneovim-43bd9c9c1cacb2f069c7e84330a608623c874d74.zip |
fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203)
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/lua/highlight_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua index 8f099ac233..66095121b0 100644 --- a/test/functional/lua/highlight_spec.lua +++ b/test/functional/lua/highlight_spec.lua @@ -90,6 +90,22 @@ describe('vim.highlight.range', function() | ]]) end) + + it('can use -1 or v:maxcol to indicate end of line', function() + exec_lua([[ + local ns = vim.api.nvim_create_namespace('') + vim.highlight.range(0, ns, 'Search', { 0, 4 }, { 1, -1 }, {}) + vim.highlight.range(0, ns, 'Search', { 2, 6 }, { 3, vim.v.maxcol }, {}) + ]]) + screen:expect([[ + ^asdf{10:ghjkl}{100:$} | + {10:«口=口»}{100:$} | + qwerty{10:uiop}{100:$} | + {10:口口=口口}{1:$} | + zxcvbnm{1:$} | + | + ]]) + end) end) describe('vim.highlight.on_yank', function() |