diff options
author | Georgi Kirilov <> | 2020-11-22 15:10:49 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-01-31 01:24:46 +0100 |
commit | abbe21687ba9f028d43f861038440843237597d0 (patch) | |
tree | 2aa671276687be40ae9413725c71e3af763ff783 | |
parent | 80bd5f27b72a5f11b67f4b36006b0f25627bc5d6 (diff) | |
download | vis-pairs-one-pass.tar.gz |
Fix nested escapingone-pass
-rw-r--r-- | init.lua | 33 |
1 files changed, 3 insertions, 30 deletions
@@ -49,24 +49,6 @@ local function at_pos(t, pos) if pos.start + 1 >= t[1] and pos.finish < t[#t] then return t end end -local function asymmetric(d, escaped, pos) - local p - local I = l.Cp() - local skip = escaped and escaped + l.P(1) or l.P(1) - if #d == 1 then - p = (d - l.B"\\") * I * ("\\" * l.P(1) + (skip - d))^0 * I * d - else - p = d * I * (skip - d)^0 * I * d - end - return l.Ct(I * p * I) * l.Cc(pos) / at_pos -end - -local function symmetric(d1, d2, escaped, pos) - local I = l.Cp() - local skip = escaped and escaped + l.P(1) or l.P(1) - return l.P{l.Ct(I * d1 * I * ((skip - d1 - d2) + l.V(1))^0 * I * d2 * I) * l.Cc(pos) / at_pos} -end - local function nth_innermost(t, count) local start, finish, c = 0, 0, count if #t == 5 then @@ -78,11 +60,6 @@ local function nth_innermost(t, count) return start, finish end -local precedence = { - [vis.lexers.COMMENT] = {vis.lexers.STRING}, - [vis.lexers.STRING] = {}, -} - local function selection_range(win, pos) for selection in win:selections_iterator() do if selection.pos == pos then @@ -97,9 +74,7 @@ local function any_captures(_, position, t) if type(t) == "table" then return position, t end - if t then - prev_match = position - t - end + prev_match = position end local function not_past(_, position, pos) @@ -185,11 +160,9 @@ local function get_range(key, win, pos, file_data, count) o[i] = v - 1 + correction end end - return unpack(offsets) - else - pos = correction - 1 end - until hierarchy or pos < 0 + return unpack(offsets) + end end local function keep_last(acc, cur) |