When I use the begin{}-end{} snippet to type a list environment (i.e. itemize
, enumerate
, list
, description
) in LaTeX, after I enter the environment name in brace brackets, the snippet will automatically fill one \item
inside the environment. But when I press Tab
, the cursor jumps to the position before the \item
command rather than after it, where I suppose to continue typing (see the enclosed screencast).
I’ve checked the snippet code:
<snippet>
<content><![CDATA[\\begin{${1:env}}
${1/(enumerate|itemize|list)|(description)|.*/(?1:\\item )(?2:\\item)/}$0
\\end{${1:env}}]]></content>
<tabTrigger>begin</tabTrigger>
<scope>text.tex.latex</scope>
<description>\begin{}…\end{}</description>
</snippet>
The $0
mark is indeed after the substituted \item
command.
The ST3 version I used is build 3143. This issue occurs on Windows 7 (6.1.7601), macOS (High Sierra 10.13.2), and Ubuntu 17.10, even when there is no third-party package enabled. Does anyone know how to fix this?