mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
fix(snip): use wordtrig for short triggers
This commit is contained in:
@@ -44,14 +44,15 @@ function M.ri(insert_node_id)
|
||||
return luasnip.function_node(function(args) return args[1][1] end, insert_node_id)
|
||||
end
|
||||
|
||||
function M.snip(trigger, expand, insert, condition, priority)
|
||||
function M.snip(trigger, expand, insert, condition, priority, wordTrig)
|
||||
priority = priority or 1000
|
||||
if wordTrig == nil then wordTrig = #trigger <= 2 end
|
||||
return luasnip.snippet(
|
||||
{
|
||||
trig = trigger,
|
||||
trigEngine = M.engine,
|
||||
trigEngineOpts = { condition = condition },
|
||||
wordTrig = false,
|
||||
wordTrig = wordTrig,
|
||||
priority = priority,
|
||||
snippetType = 'autosnippet',
|
||||
},
|
||||
|
||||
@@ -81,7 +81,7 @@ local smart_wrap = function(args, parent, old_state, expand)
|
||||
end
|
||||
|
||||
for _, val in pairs(operations) do
|
||||
table.insert(snippets, snip(val[1], '<>', { d(1, smart_wrap, {}, { user_args = { val } }) }, math))
|
||||
table.insert(snippets, snip(val[1], '<>', { d(1, smart_wrap, {}, { user_args = { val } }) }, math, 1500, false))
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user