diff options
author | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
---|---|---|
committer | Wu Cheng-Han | 2016-01-17 14:28:04 -0600 |
commit | eaa8ccaccb1091820d0a8d1223996a6dd057347d (patch) | |
tree | 6b4aaa3b3d1a2fed68147510142663222533775a /public/vendor/codemirror/addon/edit/closetag.js | |
parent | ce65e58096d57ace02723d11a125673f9d48c293 (diff) |
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
Diffstat (limited to 'public/vendor/codemirror/addon/edit/closetag.js')
-rw-r--r--[-rwxr-xr-x] | public/vendor/codemirror/addon/edit/closetag.js | 11 |
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) |