mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
fix(lua): don't clamp -1 or v:maxcol in vim.highlight.range() (#29203)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user