aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/lib/util/formatting.js
diff options
context:
space:
mode:
authorJonathan Duran2012-07-17 11:42:09 -0700
committerJonathan Duran2012-07-17 11:42:09 -0700
commitb4b3e45d6684e77d361b4f8ca5be4889428320c5 (patch)
tree2156d9920ea1b7db49ed6460545fea7cda121bae /imports/codemirror/lib/util/formatting.js
parent4a87ff575693509ac578d46af26fa137c0dc3f58 (diff)
parent4f737b24c19ddc02d20f9783b8b080fc6ef11142 (diff)
downloadninja-b4b3e45d6684e77d361b4f8ca5be4889428320c5.tar.gz
Merge branch 'refs/heads/NINJA-master' into TimelineUber
Diffstat (limited to 'imports/codemirror/lib/util/formatting.js')
-rw-r--r--imports/codemirror/lib/util/formatting.js9
1 files changed, 6 insertions, 3 deletions
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"] = {
84 commentStart: "/*", 84 commentStart: "/*",
85 commentEnd: "*/", 85 commentEnd: "*/",
86 wordWrapChars: [";", "\\{", "\\}"], 86 wordWrapChars: [";", "\\{", "\\}"],
87 autoFormatLineBreaks: function (text) { 87 autoFormatLineBreaks: function (text, startPos, endPos) {
88 text = text.substring(startPos, endPos);
88 return text.replace(new RegExp("(;|\\{|\\})([^\r\n])", "g"), "$1\n$2"); 89 return text.replace(new RegExp("(;|\\{|\\})([^\r\n])", "g"), "$1\n$2");
89 } 90 }
90}; 91};
@@ -125,7 +126,8 @@ CodeMirror.modeExtensions["javascript"] = {
125 return nonBreakableBlocks; 126 return nonBreakableBlocks;
126 }, 127 },
127 128
128 autoFormatLineBreaks: function (text) { 129 autoFormatLineBreaks: function (text, startPos, endPos) {
130 text = text.substring(startPos, endPos);
129 var curPos = 0; 131 var curPos = 0;
130 var reLinesSplitter = new RegExp("(;|\\{|\\})([^\r\n])", "g"); 132 var reLinesSplitter = new RegExp("(;|\\{|\\})([^\r\n])", "g");
131 var nonBreakableBlocks = this.getNonBreakableBlocks(text); 133 var nonBreakableBlocks = this.getNonBreakableBlocks(text);
@@ -158,7 +160,8 @@ CodeMirror.modeExtensions["xml"] = {
158 commentEnd: "-->", 160 commentEnd: "-->",
159 wordWrapChars: [">"], 161 wordWrapChars: [">"],
160 162
161 autoFormatLineBreaks: function (text) { 163 autoFormatLineBreaks: function (text, startPos, endPos) {
164 text = text.substring(startPos, endPos);
162 var lines = text.split("\n"); 165 var lines = text.split("\n");
163 var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"); 166 var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)");
164 var reOpenBrackets = new RegExp("<", "g"); 167 var reOpenBrackets = new RegExp("<", "g");