From 472eaf4d726dee2526712195f43c2a9ebe6ab9ac Mon Sep 17 00:00:00 2001 From: arne314 <73391160+arne314@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:32:37 +0200 Subject: [PATCH] fix(snip): engine wordtrig edge case --- lua/typstar/engine.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/typstar/engine.lua b/lua/typstar/engine.lua index b30fd9a..00cc508 100644 --- a/lua/typstar/engine.lua +++ b/lua/typstar/engine.lua @@ -106,9 +106,10 @@ function M.engine(trigger, opts) if not M.snippets_toggle or not condition() then return nil end local first_idx = 1 if max_length ~= nil then - first_idx = #line_full - max_length -- include additional char for wordtrig + -- include additional char for wordtrig + first_idx = #line_full - max_length if first_idx < 1 then - if is_fixed_length then + if is_fixed_length and first_idx < 0 then return nil else first_idx = 1