mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
use pcall when calling get_node function, since it can raise an error in some cases. (#425)
This commit is contained in:
@@ -40,8 +40,8 @@ function M.lang_skip(lnum, col)
|
||||
return false
|
||||
end
|
||||
|
||||
local node = vts.get_node({pos = {lnum - 1, col - 1}})
|
||||
if not node then
|
||||
local success, node = pcall(vts.get_node, {pos = {lnum - 1, col - 1}})
|
||||
if not success or not node then
|
||||
return false
|
||||
end
|
||||
---@diagnostic disable-next-line: missing-fields LuaLS bug
|
||||
|
||||
Reference in New Issue
Block a user