mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
fix(treesitter): handle empty region when logging (#24173)
This commit is contained in:
parent
c7e7f1d4b4
commit
e85e7fc7bc
@ -447,6 +447,9 @@ end
|
|||||||
---@private
|
---@private
|
||||||
---@param region Range6[]
|
---@param region Range6[]
|
||||||
local function region_tostr(region)
|
local function region_tostr(region)
|
||||||
|
if #region == 0 then
|
||||||
|
return '[]'
|
||||||
|
end
|
||||||
local srow, scol = region[1][1], region[1][2]
|
local srow, scol = region[1][1], region[1][2]
|
||||||
local erow, ecol = region[#region][4], region[#region][5]
|
local erow, ecol = region[#region][4], region[#region][5]
|
||||||
return string.format('[%d:%d-%d:%d]', srow, scol, erow, ecol)
|
return string.format('[%d:%d-%d:%d]', srow, scol, erow, ecol)
|
||||||
|
Loading…
Reference in New Issue
Block a user