fix(treesitter): handle empty region when logging (#24173)

This commit is contained in:
Jaehwang Jung 2023-06-28 03:05:44 +09:00 committed by GitHub
parent c7e7f1d4b4
commit e85e7fc7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -447,6 +447,9 @@ end
---@private
---@param region Range6[]
local function region_tostr(region)
if #region == 0 then
return '[]'
end
local srow, scol = region[1][1], region[1][2]
local erow, ecol = region[#region][4], region[#region][5]
return string.format('[%d:%d-%d:%d]', srow, scol, erow, ecol)