(range) bounds check for TS caps
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m33s
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m33s
This commit is contained in:
parent
dcedd7c59b
commit
bebefb601a
@ -256,6 +256,9 @@ function Range.from_tsquery_caps(bufnr, query, opts)
|
||||
Pos.new(bufnr, stop_row0 + 1, stop_col0 + 1),
|
||||
'v'
|
||||
)
|
||||
if range.stop.lnum > vim.api.nvim_buf_line_count(bufnr) then
|
||||
range.stop = range.stop:must_next(-1)
|
||||
end
|
||||
if not opts.contains_cursor or opts.contains_cursor and range:contains(cursor) then
|
||||
local capture_name = q.captures[id]
|
||||
if not ranges[capture_name] then ranges[capture_name] = {} end
|
||||
|
Loading…
x
Reference in New Issue
Block a user