Skip to content

Commit 43c8102

Browse files
committed
fix: small changes to snippets, try snippetlist?
1 parent 07ca084 commit 43c8102

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
#!/bin/lua
2-
-- local ls = require("luasnip")
3-
-- ls.log.ping()
4-
-- ls.log.set_loglevel("debug")
5-
-- vim.pretty_print(debug.getinfo(1).source:sub(2):gsub("init.lua", ""))
6-
snippet_path = debug.getinfo(1).source:sub(2):gsub("init.lua", "luasnippets")
7-
print(snippet_path)
8-
require("luasnip.loaders.from_lua").lazy_load({ paths = snippet_path })
9-
10-
-- info = debug.getinfo(1)
11-
-- print(info.source:sub(2):gsub("init.lua", ""))
1+
{
2+
[""] = {},
3+
all = {}
4+
}

lua/luasnip-latex-snippets/luasnippets/tex/commands.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ local reference_snippet_table = {
4545
M = {
4646
autosnippet({ trig='alab', name='label', dscr='add a label'},
4747
fmta([[
48-
\label{<>:<>}
48+
\label{<>:<>}<>
4949
]],
50-
{ i(1), i(0) })),
50+
{ i(1), i(2), i(0) })),
5151

5252
autosnippet({ trig='([acCer])ref', name='(acC|eq)?ref', dscr='add a reference (with autoref, cref, eqref)', regTrig = true, hidden = true},
5353
fmta([[
54-
\<>ref{<>:<>}
54+
\<>ref{<>:<>}<>
5555
]],
5656
{ f(function (_, snip)
5757
return reference_snippet_table[snip.captures[1]]
5858
end),
59-
i(1), i(0) }),
59+
i(1), i(2), i(0) }),
6060
{ condition = tex.in_text, show_condition = tex.in_text }),
6161
}
6262

@@ -144,6 +144,15 @@ local single_command_specs = {
144144
},
145145
command = [[\textit]],
146146
},
147+
ttt = {
148+
context = {
149+
name = "texttt",
150+
dscr = "monospace text",
151+
hidden = true,
152+
},
153+
command = [[\texttt]],
154+
},
155+
147156
sc = {
148157
context = {
149158
name = "textsc",

lua/luasnip-latex-snippets/luasnippets/tex/math.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ local generate_cases = function(args, snip)
7373
table.insert(nodes, t({ "\\\\", "" }))
7474
end
7575
-- fix last node.
76-
nodes[#nodes] = t("\\\\")
76+
table.remove(nodes, #nodes)
7777
return sn(nil, nodes)
7878
end
7979

0 commit comments

Comments
 (0)