Sublime Forum

Html snippets bug (?)

#1

Hi.
I’m sorry, I rarely come on this forum.
I have question about tab-completion in html-files.
I type:

div

and press tab
my code are expand to:

<div></div>

and cursor into the tag.
that’s ok
next, im typing

span

and my code looks like

<div>span</div>

and i press tab
i found this:

<div>span</div>|

but i’m expect this:

<div><span></span></div>

anyone can help me with fixing this ugly problem?
thx
sorry for bad english

0 Likes

#2

Hi. While I personally can’t reproduce this bug, my version works as expected… (not sure why. Maybe I have some different settings or because I’m using the dev version), I can offer a suggestion. When you expand a snippet such as “div,” the snippet has different fields. If you look at the status bar after expanding a snippet, in the left corner it says Field 1 or 2, or something like that. This means that pressing tab will move the cursor to the next field. If you are attempting to expand a snippet, you could try pressing control + space to expand the snippet instead of tab. Control + space is only bound to autocomplete so it won’t attempt to move to the next field. I hope this helps.

0 Likes

#3

hmmm, i’m using default settings. and when i press tab in the status bar i see “field 1 of 2”. what its meaning?

0 Likes

#4

same problem for me. html package is a bit buggy.

0 Likes

#5

anyone have ideas?

0 Likes

#6

I have the same problem too & am frequently frustrated when it occurs. What is also annoying, is when a snippet is tabtriggered from within another snippet. for example:

[code]

[/code]

if the caret is just after ‘id’ & I hit tab, it inserts another id="" making this [code]<div id=""="" class="">

[/code]

I don’t know if its a ST2 bug mixed with a ZenCoding thing or not, but I thought I would raise it here too

0 Likes