Move the caret to in front of the </h2> (where the pipe is located)
Hit enter
(1)
<html>
<body>
<h2>
Text of a <% heading %>|</h2>
</body>
</html>
Expected behavior
The indention level of a closing html tag should be decreased by one if it is moved to the next line, even if there are inline tags/sections like <% ... %> or <? ... ?> in the old line.
after
<html>
<body>
<h2>
Text of a <% heading %>
|</h2>
</body>
</html>
Actual behavior
If inline tags/sections like <% ... %> or <? ... ?> are found in the line, the auto_indent_tag function increases the indention level if a closing tag is moved to the next line.
after
<html>
<body>
<h2>
Text of a <% heading %>
|
</h2>
</body>
</html>
Suggestions
Remove the module and let the indention rules of the HTML/XML syntax packages handle indention of tags.
If it provides more logic than can be handled via Indention Rules, it should be moved to the related syntax package as it provides syntax specific functionality.
Workaround
To disable the auto_indent_tag until a fix is shipped with ST, a user could overwrite its key binding in order to make the indention rules of the syntax definition apply.
Description
The issue described at https://forum.sublimetext.com/t/indentation-when-pressing-enter-html-erb/47006 is caused by the
auto_indent_tag
text command which is provided by theDefault.sublime-package/auto_indent_tag.py
module.The command is bound to the
enter
key as follows:Steps to reproduce
</h2>
(where the pipe is located)(1)
Expected behavior
The indention level of a closing html tag should be decreased by one if it is moved to the next line, even if there are inline tags/sections like
<% ... %>
or<? ... ?>
in the old line.after
Actual behavior
If inline tags/sections like
<% ... %>
or<? ... ?>
are found in the line, theauto_indent_tag
function increases the indention level if a closing tag is moved to the next line.after
Suggestions
Remove the module and let the indention rules of the HTML/XML syntax packages handle indention of tags.
If it provides more logic than can be handled via Indention Rules, it should be moved to the related syntax package as it provides syntax specific functionality.
Workaround
To disable the
auto_indent_tag
until a fix is shipped with ST, a user could overwrite its key binding in order to make the indention rules of the syntax definition apply.Environment