autoclose-html icon indicating copy to clipboard operation
autoclose-html copied to clipboard

Auto tab when pressing enter on inline elements

Open Flynsarmy opened this issue 10 years ago • 3 comments

Say I have the following in my editor <p></p> with my cursor in the center. When pressing new line, I'd like the cursor to appear in the same way it does when autoclosing non inline elements - a blank line is inserted and the cursor is tabbed in one level. Like so:

<p>
    |
</p>

Flynsarmy avatar Mar 07 '14 22:03 Flynsarmy

Thanks for all the feedback!

This isn't entirely in the scope of this package, as I'd imagined it. Currently only acts on the user pressing '>'

that isn't to say it's not possible to build this functionality but perhaps it'd be better as it's own package. I can look into it this weekend, if it's not too much trouble I'll maybe add it under a preference.

mattberkowitz avatar Mar 07 '14 22:03 mattberkowitz

I am also looking for this behavior. Every once in a while I want a typically inline tag to be multiline. Right now I have to hit enter twice, then go up a line and tab.

It would be great if you could add the reverse behavior as well: when you press backspace in an empty multiline tag, it should collapse to an inline tag:

<p>
    |
</p>

press backspace...

<p>|</p>

An ok-but-not-ideal solution would be custom keybindings for this, as suggested in #120.

benlind avatar Jan 27 '17 19:01 benlind

+1 for me as well. @benlind I would like something similar as well, but my preference is to have all autocomplete tags to be inline, then pressing enter would cause it to a multiline tag. I know Coda 2 has this functionality.

@mattberkowitz Any plans to do something like this?

ngurney avatar Apr 06 '17 00:04 ngurney