diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -23,9 +23,9 @@ local count local char_next = 17 -local function at_or_after(_, _, pos, start, finish) +local function at_or_after(_, _, pos, start, finish, is_number) if start and finish then - if pos >= start and pos < finish or pos < start then + if pos >= start and pos < finish or is_number and pos < start then return true, start, finish end end @@ -38,8 +38,8 @@ local function ordinal(win, pos) end local line = win.file.lines[selection.line] local dec_num = P"-"^-1 * R"09"^1 - local patt = dec_num + ordinal_words - local start, finish = P{Cmt(Cc(selection.col) * Cp() * patt * Cp(), at_or_after) + 1 * V(1)}:match(line) + local patt = Cp() * dec_num * Cp() * Cc(true) + Cp() * ordinal_words * Cp() + local start, finish = P{Cmt(Cc(selection.col) * patt, at_or_after) + 1 * V(1)}:match(line) if not (start and finish) then return end local line_begin = selection.pos - selection.col + 1 return line_begin + start - 1, line_begin + finish - 1 |