diff options
author | Georgi Kirilov <> | 2020-11-22 15:10:50 +0200 |
---|---|---|
committer | Georgi Kirilov <> | 2023-10-04 18:24:59 +0800 |
commit | a10b35c0e3047a8856563863f6d4b2db2ead6c48 (patch) | |
tree | e6fa3fbf9d0bd1626f84aaa4fd907e8e064c0400 | |
parent | d4b729ca15051789cd42473c2aa4b184c4bfabe7 (diff) | |
download | vis-pairs-a10b35c0e3047a8856563863f6d4b2db2ead6c48.tar.gz |
Separate aux info and delimiters in custom definitions
-rw-r--r-- | pairs.lua | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -209,9 +209,9 @@ local function get_delimiters(key, win, pos) local content = win.file:content(0, win.file.size) local start, finish = get_range(key, win, pos, content) if start and finish then - return {win.file:content(start[1], start[2] - start[1]), win.file:content(finish[1], finish[2] - finish[1]), d[3], d[4]} + return {win.file:content(start[1], start[2] - start[1]), win.file:content(finish[1], finish[2] - finish[1]), d[3], d.prompt} elseif #d > 2 then - return {nil, nil, d[3], d[4]} + return {nil, nil, d[3], d.prompt} end end @@ -339,8 +339,8 @@ vis.events.subscribe(vis.events.INIT, function() local tag_name = (l.S"_:" + l.R("az", "AZ")) * (l.R("az", "AZ", "09") + l.S"_:.-")^0 local noslash = {--[[implicit:]] p=1, dt=1, dd=1, li=1, --[[void:]] area=1, base=1, br=1, col=1, embed=1, hr=1, img=1, input=1, link=1, meta=1, param=1, source=1, track=1, wbr=1} local function is_not(_, _, v) return v ~= 1 end - local html_tag = {"<" * l.Cg(l.Cmt(tag_name / string.lower / noslash, is_not), "t") * (1 - l.S"><")^0 * (">" - l.B"/"), end_tag("</", ">", casecmp), {"<\xef\xbf\xbd>", "</\xef\xbf\xbd>"}, "tag name"} - local xml_tag = {"<" * l.Cg(tag_name, "t") * (1 - l.S"><")^0 * (">" - l.B"/"), end_tag("</", ">", cmp), {"<\xef\xbf\xbd>", "</\xef\xbf\xbd>"}, "tag name", "<tag></tag> block"} + local html_tag = {"<" * l.Cg(l.Cmt(tag_name / string.lower / noslash, is_not), "t") * (1 - l.S"><")^0 * (">" - l.B"/"), end_tag("</", ">", casecmp), {"<\xef\xbf\xbd>", "</\xef\xbf\xbd>"}, prompt = "tag name"} + local xml_tag = {"<" * l.Cg(tag_name, "t") * (1 - l.S"><")^0 * (">" - l.B"/"), end_tag("</", ">", cmp), {"<\xef\xbf\xbd>", "</\xef\xbf\xbd>"}, prompt = "tag name", name = "<tag></tag> block"} local function any_pair(set, default) return {l.Cg(l.S(set), "s"), l.Cmt(l.Cb("s") * l.C(1), function(_, _, c1, c2) return builtin_textobjects[c1][2] == c2 end), builtin_textobjects[default]} end local any_bracket = any_pair("({[", "(") local presets = { @@ -366,7 +366,7 @@ vis.events.subscribe(vis.events.INIT, function() end end for key, d in pairs(M.map[1]) do - builtin_textobjects[key] = {d[1], d[2], name = d[#d]} + builtin_textobjects[key] = {d[1], d[2], name = d.name} builtin_motions[M.prefix.opening][key] = true builtin_motions[M.prefix.closing][key] = true end |