Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve indentation for writing html

  • Loading branch information...
commit 664073f5975834f11b80e5aa2aa6c3da5b455e0d 1 parent 3dca6dd
@mishoo authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/js/ymacs-mode-xml.js
View
7 src/js/ymacs-mode-xml.js
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.