Sublime Forum

Html autocompletion two elements

#1

Is it just me, or when I do p+tab (autocomplete) it puts my cursor between them, but then, if I try to autocomplete anything else between this, it does not work, the tab just puts my cursor at the end of the closing tag. If you want to try, type

only with the autocompletion, so ‘p+tab’ and ‘a+tab’

Any ideas about this? I’m on 2059 on Mac OSX

Thanks!

0 Likes

#2

You just need to have a space before the closing paragraph tag, like this;

<p>a </p> 

If you hit a+tab in there it will auto complete.

0 Likes

#3

Does not work, and the extra task of hitting space, then left arrow, and then tab is a bit too long anyway no?

0 Likes

#4

Of course it’s too long. Maybe it’s not a priority now but shouldn’t look like this in the release version. Chaining is supported by most of rival editors.

0 Likes

#5

Any updates on this Jon or any admins? I’m running the latest dev build, always hoping it gets fixed :smile:

Perhaps, nice job so far on Sublime text 2, really doing a good job.

0 Likes

#6

When a snippet is active, pressing tab will jump to the next snippet field, in preference to inserting a new snippet using the text at the cursor. In the situation you’re describing, a snippet is active - you can see this by the “Field 1 of 2” text in the status bar.

You can:

  • Press escape to indicate you’re finished with the current sinpet
  • Use ctrl+space to insert the completion, which will work irrespective of if a snippet is active
0 Likes

#7

Thank you @jps, it makes sense, did not know about the escape trick!

Now, is it just me or the dev 2074 is broken? When I tab 2 times de tab key, it inserts the snippet that is at the top of my list and then it sticks to it :astonished: in my case

I’m on mac btw

0 Likes