From 0e04fff0ea80fa5cbe96b8354db38bd334aea83a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 16:04:05 -0700 Subject: upgrade to codemirror 2.3 Signed-off-by: Ananya Sen Conflicts: js/code-editor/codemirror-ninja/theme/lesser-dark-ninja.css Signed-off-by: Ananya Sen --- imports/codemirror/lib/util/formatting.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'imports/codemirror/lib/util/formatting.js') diff --git a/imports/codemirror/lib/util/formatting.js b/imports/codemirror/lib/util/formatting.js index e1891191..3a1a9873 100644 --- a/imports/codemirror/lib/util/formatting.js +++ b/imports/codemirror/lib/util/formatting.js @@ -84,7 +84,8 @@ CodeMirror.modeExtensions["css"] = { commentStart: "/*", commentEnd: "*/", wordWrapChars: [";", "\\{", "\\}"], - autoFormatLineBreaks: function (text) { + autoFormatLineBreaks: function (text, startPos, endPos) { + text = text.substring(startPos, endPos); return text.replace(new RegExp("(;|\\{|\\})([^\r\n])", "g"), "$1\n$2"); } }; @@ -125,7 +126,8 @@ CodeMirror.modeExtensions["javascript"] = { return nonBreakableBlocks; }, - autoFormatLineBreaks: function (text) { + autoFormatLineBreaks: function (text, startPos, endPos) { + text = text.substring(startPos, endPos); var curPos = 0; var reLinesSplitter = new RegExp("(;|\\{|\\})([^\r\n])", "g"); var nonBreakableBlocks = this.getNonBreakableBlocks(text); @@ -158,7 +160,8 @@ CodeMirror.modeExtensions["xml"] = { commentEnd: "-->", wordWrapChars: [">"], - autoFormatLineBreaks: function (text) { + autoFormatLineBreaks: function (text, startPos, endPos) { + text = text.substring(startPos, endPos); var lines = text.split("\n"); var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"); var reOpenBrackets = new RegExp("<", "g"); -- cgit v1.2.3