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).
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?
I’m guessing that ST calculates the region where $0 refers to before any substitutions take place, i.e. it’s a static position. So not necessarily a bug per se, but an implementation detail that prevents it from working the way you want it to.
Thanks for your explanation. That issue doesn’t seem very helpful.
After a few tries, I find that if there are any characters between the substitution and the $0 mark, then the tab navigation will work as what I expect, i.e., the cursor will jump to the location where $0 is no matter whether the substitution takes place or not.
However, this is an ugly workaround, because the additional character inserted before $0 mark will still be there.
Maybe such a problem is an intentional design, but I still think it is more like a bug because when the substitution part is put before the $0 mark in the snippet, it is supposed the substitution and the region where $0 refers to will follow the order