mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 13:34:24 -05:00
perf: jsregexp instead of lua pattern matching
This commit is contained in:
@@ -32,7 +32,14 @@ end
|
||||
function M.snip(trigger, expand, insert, condition, priority)
|
||||
priority = priority or 1000
|
||||
return luasnip.snippet(
|
||||
{ trig = trigger, regTrig = true, wordtrig = false, priority = priority, snippetType = 'autosnippet' },
|
||||
{
|
||||
trig = trigger,
|
||||
trigEngine = 'ecma',
|
||||
regTrig = true,
|
||||
wordtrig = false,
|
||||
priority = priority,
|
||||
snippetType = 'autosnippet'
|
||||
},
|
||||
fmta(expand, { unpack(insert) }),
|
||||
{
|
||||
condition = function()
|
||||
@@ -46,7 +53,7 @@ function M.snip(trigger, expand, insert, condition, priority)
|
||||
end
|
||||
|
||||
function M.start_snip(trigger, expand, insert, condition, priority)
|
||||
return M.snip('^%s*' .. trigger, expand, insert, condition, priority)
|
||||
return M.snip('^\\s*' .. trigger, expand, insert, condition, priority)
|
||||
end
|
||||
|
||||
function M.toggle_autosnippets()
|
||||
|
||||
Reference in New Issue
Block a user