summaryrefslogtreecommitdiffstats
path: root/pairs.lua
diff options
context:
space:
mode:
authorGeorgi Kirilov <>2020-11-22 15:10:49 +0200
committerGeorgi Kirilov <>2023-10-04 18:24:59 +0800
commit6f02304e2530c5ee843e6a7081d5bfbb2f03393c (patch)
tree95fff8a4400e3d20647cc07a1054023cc7d91712 /pairs.lua
parent29a137c58077c4a4c521f1859d56a0da946c8ab9 (diff)
downloadvis-pairs-6f02304e2530c5ee843e6a7081d5bfbb2f03393c.tar.gz
Fix outer object when cursor is on its last char
It skipped right to the parent object without first selecting the current one.
Diffstat (limited to 'pairs.lua')
-rw-r--r--pairs.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/pairs.lua b/pairs.lua
index b624b50..1bed58a 100644
--- a/pairs.lua
+++ b/pairs.lua
@@ -108,7 +108,7 @@ local function get_expanded_state(win, key)
for selection in win:selections_iterator() do
local range = selection.range
local start, finish = get_range(key, win.file, selection.pos)
- if start and finish and start[1] - 1 < range.start and range.finish < finish[2] then
+ if start and finish and (range.finish - range.start) < (finish[2] - start[1]) then
return false
end
end