'Strange cursor location after using begin{}-end{} snippet in Sublime Text

When I write LaTeX in Sublime Text, if the begin{}-end{} snippet is triggered for a list environment (enumerate, itemize, list, and description), a \item will be added automatically. But when I press the Tab key to leave the environment name field, the cursor will jump to the position before \item rather than after it. This looks strange because usually it is expected that the cursor should move to the position after the \item command so one can continue to type the text of the list item.

Strange cursor location of Sublime Text snippet
(source: sinaimg.cn)

I've checked the snippet code provided in the build-in package LaTeX of Sublime Text:

<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 put after the \item inserted by the substitution.

I use Sublime Text 3 build 3143. This issue occurs on both macOS High Sierra and Windows 7 (6.1.7601), even when no third-party package is enabled.

If this is not a bug of Sublime Text, what additional configuration am I missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source