From ae38a4c09b4342731a9a538401e2253a3c988cb6 Mon Sep 17 00:00:00 2001 From: arne314 <73391160+arne314@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:44:36 +0200 Subject: [PATCH] fix: allow overriding of computed max trig length --- lua/typstar/autosnippets.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/typstar/autosnippets.lua b/lua/typstar/autosnippets.lua index 98064b3..60feb5e 100644 --- a/lua/typstar/autosnippets.lua +++ b/lua/typstar/autosnippets.lua @@ -99,7 +99,7 @@ function M.engine(trigger, opts) -- determine possibly max/fixed length of trigger local max_length = opts.maxTrigLength local is_fixed_length = false - if alts_regex ~= '' and not trigger:match('[%+%*]') then + if max_length ~= nil and alts_regex ~= '' and not trigger:match('[%+%*]') then max_length = #trigger - utils.count_string(trigger, '\\') - utils.count_string(trigger, '%(')