From 499547fe60580e94af056a7ed192d08c3114bc85 Mon Sep 17 00:00:00 2001 From: gzqx <24262751+gzqx@users.noreply.github.com> Date: Fri, 8 Mar 2024 19:58:38 +0800 Subject: [PATCH 1/6] change space in \label to - --- snippets/tex.snippets | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index 4d54fe011..afc473f53 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -152,63 +152,63 @@ snippet spl split environment # Part snippet part document \part \\part{${1:part name}} % (fold)% - \\label{prt:${2:$1}} + \\label{prt:${2:${1/\W+/-/g}}} ${0} % part $2 (end) # Chapter snippet cha \chapter \\chapter{${1:chapter name}}% - \\label{cha:${2:$1}} + \\label{cha:${2:${1/\W+/-/g}}} ${0} # Section snippet sec \section \\section{${1:section name}}% - \\label{sec:${2:$1}} + \\label{sec:${2:${1/\W+/-/g}}} ${0} # Section without number snippet sec* \section* \\section*{${1:section name}}% - \\label{sec:${2:$1}} + \\label{sec:${2:${1/\W+/-/g}}} ${0} # Sub Section snippet sub \subsection \\subsection{${1:subsection name}}% - \\label{sub:${2:$1}} + \\label{sub:${2:${1/\W+/-/g}}} ${0} # Sub Section without number snippet sub* \subsection* \\subsection*{${1:subsection name}}% - \\label{sub:${2:$1}} + \\label{sub:${2:${1/\W+/-/g}}} ${0} # Sub Sub Section snippet ssub \subsubsection \\subsubsection{${1:subsubsection name}}% - \\label{ssub:${2:$1}} + \\label{ssub:${2:${1/\W+/-/g}}} ${0} # Sub Sub Section without number snippet ssub* \subsubsection* \\subsubsection*{${1:subsubsection name}}% - \\label{ssub:${2:$1}} + \\label{ssub:${2:${1/\W+/-/g}}} ${0} # Paragraph snippet par \paragraph \\paragraph{${1:paragraph name}}% - \\label{par:${2:$1}} + \\label{par:${2:${1/\W+/-/g}}} ${0} # Paragraph* snippet par* \paragraph* \\paragraph*{${1:paragraph name}}% - \\label{par:${2:$1}} + \\label{par:${2:${1/\W+/-/g}}} ${0} # Sub Paragraph snippet subp \subparagraph \\subparagraph{${1:subparagraph name}}% - \\label{subp:${2:$1}} + \\label{subp:${2:${1/\W+/-/g}}} ${0} # Sub Paragraph* snippet subp* \subparagraph* \\subparagraph*{${1:subparagraph name}}% - \\label{subp:${2:$1}} + \\label{subp:${2:${1/\W+/-/g}}} ${0} snippet ni \noindent \\noindent From 018cd4d101faf05d75f70066cfa810a74f6f6e2a Mon Sep 17 00:00:00 2001 From: gzqx <24262751+gzqx@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:09:11 +0800 Subject: [PATCH 2/6] test --- snippets/tex.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index afc473f53..229b765dc 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -163,7 +163,7 @@ snippet cha \chapter # Section snippet sec \section \\section{${1:section name}}% - \\label{sec:${2:${1/\W+/-/g}}} + \\label{sec:${2:${1/\\W+/-/g}}} ${0} # Section without number snippet sec* \section* From 51bb886e048eca3170f9644f65a8f1dd9cfbcd94 Mon Sep 17 00:00:00 2001 From: gzqx <24262751+gzqx@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:13:49 +0800 Subject: [PATCH 3/6] test --- snippets/tex.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index 229b765dc..40dc75eec 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -163,7 +163,7 @@ snippet cha \chapter # Section snippet sec \section \\section{${1:section name}}% - \\label{sec:${2:${1/\\W+/-/g}}} + \\label{sec:${2:${1/section/-/g}}} ${0} # Section without number snippet sec* \section* From 22b1f6b0cc47eedd1c715e3df9165cbb45dfa1a5 Mon Sep 17 00:00:00 2001 From: gzqx <24262751+gzqx@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:32:47 +0800 Subject: [PATCH 4/6] test --- snippets/tex.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index 40dc75eec..229b765dc 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -163,7 +163,7 @@ snippet cha \chapter # Section snippet sec \section \\section{${1:section name}}% - \\label{sec:${2:${1/section/-/g}}} + \\label{sec:${2:${1/\\W+/-/g}}} ${0} # Section without number snippet sec* \section* From bc8f761a665c0c59dcfb8971fae0ed6077960889 Mon Sep 17 00:00:00 2001 From: gzqx <24262751+gzqx@users.noreply.github.com> Date: Fri, 8 Mar 2024 22:55:17 +0800 Subject: [PATCH 5/6] fix label --- snippets/tex.snippets | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/snippets/tex.snippets b/snippets/tex.snippets index 229b765dc..5e8db29bf 100644 --- a/snippets/tex.snippets +++ b/snippets/tex.snippets @@ -152,63 +152,63 @@ snippet spl split environment # Part snippet part document \part \\part{${1:part name}} % (fold)% - \\label{prt:${2:${1/\W+/-/g}}} + \\label{prt:${2:${1/\W/-/g}}} ${0} % part $2 (end) # Chapter snippet cha \chapter \\chapter{${1:chapter name}}% - \\label{cha:${2:${1/\W+/-/g}}} + \\label{cha:${2:${1/\W/-/g}}} ${0} # Section snippet sec \section \\section{${1:section name}}% - \\label{sec:${2:${1/\\W+/-/g}}} + \\label{sec:${2:${1/\W/-/g}}} ${0} # Section without number snippet sec* \section* \\section*{${1:section name}}% - \\label{sec:${2:${1/\W+/-/g}}} + \\label{sec:${2:${1/\W/-/g}}} ${0} # Sub Section snippet sub \subsection \\subsection{${1:subsection name}}% - \\label{sub:${2:${1/\W+/-/g}}} + \\label{sub:${2:${1/\W/-/g}}} ${0} # Sub Section without number snippet sub* \subsection* \\subsection*{${1:subsection name}}% - \\label{sub:${2:${1/\W+/-/g}}} + \\label{sub:${2:${1/\W/-/g}}} ${0} # Sub Sub Section snippet ssub \subsubsection \\subsubsection{${1:subsubsection name}}% - \\label{ssub:${2:${1/\W+/-/g}}} + \\label{ssub:${2:${1/\W/-/g}}} ${0} # Sub Sub Section without number snippet ssub* \subsubsection* \\subsubsection*{${1:subsubsection name}}% - \\label{ssub:${2:${1/\W+/-/g}}} + \\label{ssub:${2:${1/\W/-/g}}} ${0} # Paragraph snippet par \paragraph \\paragraph{${1:paragraph name}}% - \\label{par:${2:${1/\W+/-/g}}} + \\label{par:${2:${1/\W/-/g}}} ${0} # Paragraph* snippet par* \paragraph* \\paragraph*{${1:paragraph name}}% - \\label{par:${2:${1/\W+/-/g}}} + \\label{par:${2:${1/\W/-/g}}} ${0} # Sub Paragraph snippet subp \subparagraph \\subparagraph{${1:subparagraph name}}% - \\label{subp:${2:${1/\W+/-/g}}} + \\label{subp:${2:${1/\W/-/g}}} ${0} # Sub Paragraph* snippet subp* \subparagraph* \\subparagraph*{${1:subparagraph name}}% - \\label{subp:${2:${1/\W+/-/g}}} + \\label{subp:${2:${1/\W/-/g}}} ${0} snippet ni \noindent \\noindent From e446bcbac73b3ea518e3225575e0a4bf95bd3c29 Mon Sep 17 00:00:00 2001 From: X Z <24262751+gzqx@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:30:27 +0800 Subject: [PATCH 6/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8cf06c4b8..dfb848a2c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +This fork fixes https://github.com/honza/vim-snippets/issues/1514. + snipMate & UltiSnip Snippets ============================