Sublime Forum

Annoying outdent when typing html

#1

I’m having a problem with automatic indentation. Here’s the situation. I’ll use a pipe character to indicate where my cursor is.

<div>
</div>|

Then (using vintage mode), I press O, which gives me this

<div>
    |
</div>

Great, I think, my indentation is correct I’m ready to start typing. So (in insert mode), let’s say I press h. Then I get this:

<div>
h|
</div>

Why did sublime outdent me when I started typing? I’ve messed around with most of the indentation-related preferences, to no avail.

0 Likes

#2

I know that my answer is not helpful to you but look what I’ve got when typing some HTML code.
I wanted for

tag to be also auto-completed but no, it just goes outside.
http://imageshack.com/a/img538/1183/8ELwJk.gif
This was due to my tinkering with html_completions.py in HTML package.
The cursor is going outside of div tag because i changed one line in that file ($0 to end:

return (tag + "\tTag", tag + ">$1</" + tag + '>$0')

Maybe you can do something similar to achieve behavior you want.

0 Likes