Skip to content

Commit

Permalink
fix: EOL patterns match before cursor position (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanaigr authored Apr 27, 2024
1 parent 0190e07 commit 7681908
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/spider/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ local function firstMatchAfter(line, pattern, endOfWord, offset)
if start == nil or endPos == nil then return nil end

local pos = endOfWord and endPos or start
return pos
if pos > offset then return pos
else return nil end
end

if endOfWord then
Expand Down Expand Up @@ -180,8 +181,7 @@ function M.motion(key, motionOpts)
local result = getNextPosition(line, offset, key, opts)
if result then
offset = result
local onTheSamePos = (offset == startOffset and row == startRow)
if not onTheSamePos then break end
break
end

offset = 0
Expand Down

0 comments on commit 7681908

Please sign in to comment.