fix: Use multiline snippets with higher priority

This commit is contained in:
Sayantan Santra 2024-06-02 20:52:07 -05:00
parent 5a7f792989
commit 496a1e8053
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -38,7 +38,7 @@ post_jump "delline_exititemize(snip)"
snippet "\\item\s*$" "exit itemize_like envs" rb
endsnippet
snippet "\\begin\{(itemize|enumerate)\}(\[\w+\])?" "multiline begin{} / end{}" rb
snippet "\\begin\{(itemize|enumerate)\}(\[\w+\])?" "itemize-like envs multiline begin{} / end{}" rb
\begin{`!p snip.rv = match.group(1)`}`!p snip.rv = suppress_none(match.group(2))`
\item $0
\end{`!p snip.rv = match.group(1)`}
@ -52,6 +52,8 @@ snippet "\\begin\{(\w+)\}(\[\w+\])?" "multiline begin{} / end{}" rb
\end{`!p snip.rv = match.group(1)`}
endsnippet
priority -30
snippet "(?<!^)\\begin\{(\w+)\}" "inline begin{} / end{}" ri
\begin{`!p snip.rv = match.group(1)`} $1 \end{`!p snip.rv = match.group(1)`} $0
endsnippet