summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pairs.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/pairs.lua b/pairs.lua
index 9bed905..f45a947 100644
--- a/pairs.lua
+++ b/pairs.lua
@@ -224,8 +224,8 @@ end
local function opening(win, pos, content, count)
local start, _ = get_range(M.key, win, pos, content, count)
if not start then return pos end
- local exclusive = vis.mode == vis.modes.OPERATOR_PENDING or vis.mode == vis.modes.VISUAL and pos < start[2] - 1
- return start[2] - 1 + (exclusive and 1 or 0)
+ local exclusive = vis.mode == vis.modes.OPERATOR_PENDING and pos >= start[2] or vis.mode == vis.modes.VISUAL and pos < start[2] - 1
+ return start[2] - 1 + (exclusive and 1 or 0), vis.mode == vis.modes.OPERATOR_PENDING and pos >= start[2]
end
local function closing(win, pos, content, count)