feat(snip): otn for generic number series

This commit is contained in:
arne314
2025-08-26 21:14:35 +02:00
parent b061332102
commit 97efdf064e
3 changed files with 3 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ function M.engine(trigger, opts)
-- custom word trig
local from = #line - #whole + 1
if opts.wordTrig and from ~= 1 and string.match(string.sub(line, from - 1, from - 1), '[%w.]') ~= nil then
if opts.wordTrig and from ~= 1 and string.match(line:sub(from - 1, from - 1), '[%w._]') ~= nil then
return nil
end

View File

@@ -129,6 +129,7 @@ return {
),
-- series of numbered letters
snip('ot(\\w) ', '1, 2, ..., <> ', { cap(1) }, math, 800), -- 1, 2, ..., n
snip('(' .. trigger_index_pre .. ') ot ', '<>_1, <>_2, ... ', { cap(1), cap(1) }, math), -- a_1, a_2, ...
snip('(' .. trigger_index_pre .. ') ot(\\w+) ', '<> ', { d(1, get_series) }, math, 1000, { maxTrigLength = 13 }), -- a_1, a_2, ... a_j or a_1, a_2, a_2, a_3, a_4, a_5