autoclose-html
autoclose-html copied to clipboard
Extra Indentation on close tag
Atom: 1.32.0 OS: Mac OS High Sierra 10.13.6 Autoclose HTML: 0.23.0
When creating a new html block, the closing tag indentation is always one indent unit whether set to 2 or 4 spaces. Problem did not appear using earlier versions of Atom and began after an auto update.
Example:
<div class="row">
<div class="col-xs-12">
</div>
</div>
appears as
<div class="row">
<div class="col-xs-12">
</div>
</div>
When using 2 spaces for the default indentation level.
It appears the offending lines are in autoclose-html.coffee#177:
if not isInline
editor.insertNewline()
editor.insertNewline()
editor.insertText('</' + eleTag + '>')
It appears the double new line on my specific machine is not resetting the indentation level.
Was able to solve by having the editor backspace in between the new lines.
editor.insertNewLine()
editor.backspace()
editor.insertNewLine()
I was looking at an issue with another atom package, and the culprit there was having Tree Sitter Parsers
enabled. When I disabled that option (Settings -> Core -> Use Tree Sitter Parsers
), this annoying indentation problem also disappeared.
Was able to solve by having the editor backspace in between the new lines.
editor.insertNewLine() editor.backspace() editor.insertNewLine()
Experiencing the same issue and this workaround fixed it for me as well.
@TruRooms Please make a fork and upload this to Atom!
@seanhuber I have also found this problem!
@mattberkowitz @CoWinkKeyDinkInc The problem has been generated #210
Atom: 1.32.0 OS: Mac OS High Sierra 10.13.6 Autoclose HTML: 0.23.0
When creating a new html block, the closing tag indentation is always one indent unit whether set to 2 or 4 spaces. Problem did not appear using earlier versions of Atom and began after an auto update.
Example:
<div class="row"> <div class="col-xs-12"> </div> </div>
appears as
<div class="row"> <div class="col-xs-12"> </div> </div>
When using 2 spaces for the default indentation level.
It appears the offending lines are in autoclose-html.coffee#177:
if not isInline editor.insertNewline() editor.insertNewline() editor.insertText('</' + eleTag + '>')
It appears the double new line on my specific machine is not resetting the indentation level.
The problem is at line #117, not #177.
Atom: 1.32.0 OS: Mac OS High Sierra 10.13.6 Autoclose HTML: 0.23.0 When creating a new html block, the closing tag indentation is always one indent unit whether set to 2 or 4 spaces. Problem did not appear using earlier versions of Atom and began after an auto update. Example:
<div class="row"> <div class="col-xs-12"> </div> </div>
appears as
<div class="row"> <div class="col-xs-12"> </div> </div>
When using 2 spaces for the default indentation level. It appears the offending lines are in autoclose-html.coffee#177:
if not isInline editor.insertNewline() editor.insertNewline() editor.insertText('</' + eleTag + '>')
It appears the double new line on my specific machine is not resetting the indentation level.
The problem is at line #117, not #177.
I forked the code, added the above correction. My repo is here:
https://github.com/Ordinal-Data-Inc/autoclose-html.git
The README.md in my repo has the (temporary) installation instructions to the updated code. Hopefully this will be included in an upcoming update to main.
This package is no longer being maintained. However, my fork shouldn't have the issue described, and is a published package: https://github.com/binaryfunt/autoclose-html-plus