From db88f070ec253d0b055a03f8b66e0564310839af Mon Sep 17 00:00:00 2001 From: arne314 <73391160+arne314@users.noreply.github.com> Date: Sun, 4 May 2025 15:49:55 +0200 Subject: [PATCH] fix: survive multiple plugin setup calls --- 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 10e0907..8e73b96 100644 --- a/lua/typstar/autosnippets.lua +++ b/lua/typstar/autosnippets.lua @@ -198,7 +198,7 @@ function M.setup() jsregexp_ok, jsregexp = pcall(require, 'jsregexp') end if jsregexp_ok then - alts_regex = jsregexp.compile_safe(alts_regex) + if type(alts_regex) == 'string' then alts_regex = jsregexp.compile_safe(alts_regex) end else alts_regex = '' vim.notify("WARNING: Most snippets won't work as jsregexp is not installed", vim.log.levels.WARN)