mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
feat(snip): otn for generic number series
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user