Skip to content

Commit

Permalink
improve indentation for writing html
Browse files Browse the repository at this point in the history
  • Loading branch information
mishoo committed Dec 29, 2012
1 parent 3dca6dd commit 664073f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/ymacs-mode-xml.js
Expand Up @@ -207,7 +207,12 @@ Ymacs_Tokenizer.define("xml", function(stream, tok) {
indent = stream.lineIndentation($inComment.line) + INDENT_LEVEL();
}
else if ($inTag) {
indent = $inTag.c1 + $inTag.id.length + 1;
var txt = stream.lineText($inTag.line);
if (/^\s*$/.test(txt.substr(0, $inTag.c1 - 1))) {
indent = $inTag.c1 + $inTag.id.length + 1;
} else {
indent = stream.lineIndentation($inTag.line);
}
}
else if ((lastTag = $tags.peek())) {
indent = stream.lineIndentation(lastTag.line) + INDENT_LEVEL();
Expand Down

0 comments on commit 664073f

Please sign in to comment.