fix: Fix luasnip helpers.fill

This commit is contained in:
punkfairie 2025-01-04 21:53:53 -08:00
parent 2f8570871f
commit c574208de4
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696

View file

@ -1,24 +1,24 @@
local ls = require("luasnip")
local ls = require('luasnip')
local sn = ls.snippet_node
local i = ls.insert_node
local M = {}
M.fill = function(_, parent, args)
local title = ""
local title = ''
local chars = {}
if #parent.snippet.env.LS_SELECT_RAW > 0 then
if type(parent.snippet.env.LS_SELECT_RAW) == 'table' then
for _, ele in ipairs(parent.snippet.env.LS_SELECT_RAW) do
title = title .. ele .. " "
title = title .. ele .. ' '
end
end
for str in string.gmatch(args, "([^%%]+)") do
for str in string.gmatch(args, '([^%%]+)') do
table.insert(chars, str)
end
local snip = chars[1] .. " " .. title
local snip = chars[1] .. ' ' .. title
local _, c = unpack(vim.api.nvim_win_get_cursor(0))