From 82752ca5d1e3bac5473de9936d864b58171ab2d8 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
Date: Mon, 20 May 2013 15:55:40 +0200
Subject: [PATCH 001/143] Bump version number post-3.13
---
lib/codemirror.js | 2 +-
package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/codemirror.js b/lib/codemirror.js
index b42c321527..732f549084 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -5629,7 +5629,7 @@ window.CodeMirror = (function() {
// THE END
- CodeMirror.version = "3.13";
+ CodeMirror.version = "3.13 +";
return CodeMirror;
})();
diff --git a/package.json b/package.json
index 05c946b726..7e0d64a71c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "codemirror",
- "version":"3.13.00",
+ "version":"3.13.01",
"main": "lib/codemirror.js",
"description": "In-browser code editing made bearable",
"licenses": [{"type": "MIT",
From 51292d0b8d2c632eeeccbd6ff83a88316a83c038 Mon Sep 17 00:00:00 2001
From: lynschinzer
Date: Mon, 20 May 2013 14:11:56 +0200
Subject: [PATCH 002/143] [vim keymap] Minor fixup for macro normalMode
---
keymap/vim.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/keymap/vim.js b/keymap/vim.js
index 42e6ecaac0..532e640a1f 100644
--- a/keymap/vim.js
+++ b/keymap/vim.js
@@ -536,9 +536,9 @@
if (macroModeState.enteredMacroMode) {
if (key == 'q') {
actions.exitMacroRecordMode();
+ vim.inputState = new InputState();
return;
}
- logKey(macroModeState, key);
}
if (key == '') {
// Clear input state and get back to normal mode.
@@ -575,6 +575,9 @@
this.handleKey(cm, command.toKeys[i]);
}
} else {
+ if (macroModeState.enteredMacroMode) {
+ logKey(macroModeState, key);
+ }
commandDispatcher.processCommand(cm, vim, command);
}
}
@@ -3251,7 +3254,7 @@
var macroKeyBuffer = macroModeState.macroKeyBuffer;
emptyMacroKeyBuffer(macroModeState);
do {
- match = text.match(/<\w+-.+>|<\w+>|.|\n/);
+ match = (/<\w+-.+?>|<\w+>|./).exec(text);
if(match === null)break;
key = match[0];
text = text.substring(match.index + key.length);
From f8b2dcfb6e4ae86d6a67a9e5706783a8998fe4f7 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
Date: Tue, 21 May 2013 14:37:15 +0200
Subject: [PATCH 003/143] [package.json] Use 'repository' rather than
'repositories' field
Apparently the second is no longer supported in npm 1.2 (?).
---
package.json | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/package.json b/package.json
index 7e0d64a71c..80bd128efc 100644
--- a/package.json
+++ b/package.json
@@ -14,8 +14,6 @@
"maintainers":[{"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",
"web": "http://marijnhaverbeke.nl"}],
- "repositories": [{"type": "git",
- "url": "http://marijnhaverbeke.nl/git/codemirror"},
- {"type": "git",
- "url": "https://github.com/marijnh/CodeMirror.git"}]
+ "repository": {"type": "git",
+ "url": "http://marijnhaverbeke.nl/git/codemirror"}
}
From 3818137291d94bfb168e037309727040d693b756 Mon Sep 17 00:00:00 2001
From: 4r2r
Date: Wed, 22 May 2013 19:12:07 +0400
Subject: [PATCH 004/143] CodeMirror.multiplexingMode: added an innerStyle
option and test.
Example usage: applying different color schemes to submodes.
---
addon/mode/multiplex.js | 8 +++++++-
addon/mode/multiplex_test.js | 30 ++++++++++++++++++++++++++++++
demo/multiplex.html | 6 ++++++
doc/manual.html | 18 ++++++++++--------
test/index.html | 2 ++
5 files changed, 55 insertions(+), 9 deletions(-)
create mode 100644 addon/mode/multiplex_test.js
diff --git a/addon/mode/multiplex.js b/addon/mode/multiplex.js
index 3ff3a929ed..32cc579c3a 100644
--- a/addon/mode/multiplex.js
+++ b/addon/mode/multiplex.js
@@ -1,5 +1,5 @@
CodeMirror.multiplexingMode = function(outer /*, others */) {
- // Others should be {open, close, mode [, delimStyle]} objects
+ // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects
var others = Array.prototype.slice.call(arguments, 1);
var n_others = others.length;
@@ -58,6 +58,12 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
if (found > -1) stream.string = oldContent;
var cur = stream.current(), found = cur.indexOf(curInner.close);
if (found > -1) stream.backUp(cur.length - found);
+
+ if (curInner.innerStyle) {
+ if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
+ else innerToken = curInner.innerStyle;
+ }
+
return innerToken;
}
},
diff --git a/addon/mode/multiplex_test.js b/addon/mode/multiplex_test.js
new file mode 100644
index 0000000000..c0656357c7
--- /dev/null
+++ b/addon/mode/multiplex_test.js
@@ -0,0 +1,30 @@
+(function() {
+ CodeMirror.defineMode("markdown_with_stex", function(){
+ var inner = CodeMirror.getMode({}, "stex");
+ var outer = CodeMirror.getMode({}, "markdown");
+
+ var innerOptions = {
+ open: '$',
+ close: '$',
+ mode: inner,
+ delimStyle: 'delim',
+ innerStyle: 'inner'
+ };
+
+ return CodeMirror.multiplexingMode(outer, innerOptions);
+ });
+
+ var mode = CodeMirror.getMode({}, "markdown_with_stex");
+
+ function MT(name) {
+ test.mode(
+ name,
+ mode,
+ Array.prototype.slice.call(arguments, 1),
+ 'multiplexing');
+ }
+
+ MT(
+ "stexInsideMarkdown",
+ "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
+})();
diff --git a/demo/multiplex.html b/demo/multiplex.html
index 9ebe8f357b..ec0519cb98 100644
--- a/demo/multiplex.html
+++ b/demo/multiplex.html
@@ -56,5 +56,11 @@
the source for more
information.
+
+ Parsing/Highlighting Tests:
+ normal,
+ verbose.
+
+