mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor: simple logic in tree_contains()
This commit is contained in:
parent
f66a60805d
commit
fec944142b
@ -488,11 +488,7 @@ local function tree_contains(tree, range)
|
|||||||
local start_fits = start_row < range[1] or (start_row == range[1] and start_col <= range[2])
|
local start_fits = start_row < range[1] or (start_row == range[1] and start_col <= range[2])
|
||||||
local end_fits = end_row > range[3] or (end_row == range[3] and end_col >= range[4])
|
local end_fits = end_row > range[3] or (end_row == range[3] and end_col >= range[4])
|
||||||
|
|
||||||
if start_fits and end_fits then
|
return start_fits and end_fits
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Determines whether {range} is contained in this language tree
|
--- Determines whether {range} is contained in this language tree
|
||||||
|
Loading…
Reference in New Issue
Block a user