summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/edit/closetag.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/addon/edit/closetag.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/public/vendor/codemirror/addon/edit/closetag.js b/public/vendor/codemirror/addon/edit/closetag.js
index c2d2263e..a518da3e 100755..100644
--- a/public/vendor/codemirror/addon/edit/closetag.js
+++ b/public/vendor/codemirror/addon/edit/closetag.js
@@ -108,21 +108,24 @@
// when completing in JS/CSS snippet in htmlmixed mode. Does not
// work for other XML embedded languages (there is no general
// way to go from a mixed mode to its current XML state).
+ var replacement;
if (inner.mode.name != "xml") {
if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
- replacements[i] = head + "script>";
+ replacement = head + "script";
else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css")
- replacements[i] = head + "style>";
+ replacement = head + "style";
else
return CodeMirror.Pass;
} else {
if (!state.context || !state.context.tagName ||
closingTagExists(cm, state.context.tagName, pos, state))
return CodeMirror.Pass;
- replacements[i] = head + state.context.tagName + ">";
+ replacement = head + state.context.tagName;
}
+ if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
+ replacements[i] = replacement;
}
- cm.replaceSelections(replacements, null, '+input');
+ cm.replaceSelections(replacements);
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++)
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)