"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "addon/edit/closetag.js" between
CodeMirror-5.58.2.tar.gz and CodeMirror-5.58.3.tar.gz

About: CodeMirror is a text editor implemented in JavaScript for the browser and specialized for editing code.

closetag.js  (CodeMirror-5.58.2):closetag.js  (CodeMirror-5.58.3)
skipping to change at line 131 skipping to change at line 131
// when completing in JS/CSS snippet in htmlmixed mode. Does not // when completing in JS/CSS snippet in htmlmixed mode. Does not
// work for other XML embedded languages (there is no general // work for other XML embedded languages (there is no general
// way to go from a mixed mode to its current XML state). // way to go from a mixed mode to its current XML state).
var replacement, mixed = inner.mode.name != "xml" && cm.getMode().name == "htmlmixed" var replacement, mixed = inner.mode.name != "xml" && cm.getMode().name == "htmlmixed"
if (mixed && inner.mode.name == "javascript") { if (mixed && inner.mode.name == "javascript") {
replacement = head + "script"; replacement = head + "script";
} else if (mixed && inner.mode.name == "css") { } else if (mixed && inner.mode.name == "css") {
replacement = head + "style"; replacement = head + "style";
} else { } else {
var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentConte xt(state) var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentConte xt(state)
if (!context || (context.length && closingTagExists(cm, context, context var top = context.length ? context[context.length - 1] : ""
[context.length - 1], pos))) if (!context || (context.length && closingTagExists(cm, context, top, po
s)))
return CodeMirror.Pass; return CodeMirror.Pass;
replacement = head + context[context.length - 1] replacement = head + top
} }
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">"; if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
replacements[i] = replacement; replacements[i] = replacement;
} }
cm.replaceSelections(replacements); cm.replaceSelections(replacements);
ranges = cm.listSelections(); ranges = cm.listSelections();
if (!dontIndentOnAutoClose) { if (!dontIndentOnAutoClose) {
for (var i = 0; i < ranges.length; i++) for (var i = 0; i < ranges.length; i++)
if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].he ad.line) if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].he ad.line)
cm.indentLine(ranges[i].head.line); cm.indentLine(ranges[i].head.line);
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)