From 01685c255fda6e13f1cd2980130d2e388d52125c Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 4 Jul 2015 11:31:01 +0800 Subject: Updated codemirror to 5.4.0 --- public/vendor/codemirror/addon/edit/closebrackets.js | 1 + public/vendor/codemirror/addon/edit/closetag.js | 2 +- public/vendor/codemirror/addon/edit/continuelist.js | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'public/vendor/codemirror/addon/edit') diff --git a/public/vendor/codemirror/addon/edit/closebrackets.js b/public/vendor/codemirror/addon/edit/closebrackets.js index 35b5b32c..1ceda4e3 100755 --- a/public/vendor/codemirror/addon/edit/closebrackets.js +++ b/public/vendor/codemirror/addon/edit/closebrackets.js @@ -147,6 +147,7 @@ cm.replaceSelections(sels, "around", "+input"); } else if (type == "both") { cm.replaceSelection(left + right, null, "+input"); + cm.triggerElectric(left + right); cm.execCommand("goCharLeft"); } else if (type == "addFour") { cm.replaceSelection(left + left + left + left, "before", "+input"); diff --git a/public/vendor/codemirror/addon/edit/closetag.js b/public/vendor/codemirror/addon/edit/closetag.js index 4ab36cce..c2d2263e 100755 --- a/public/vendor/codemirror/addon/edit/closetag.js +++ b/public/vendor/codemirror/addon/edit/closetag.js @@ -83,7 +83,7 @@ for (var i = ranges.length - 1; i >= 0; i--) { var info = replacements[i]; - cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+input"); + cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert"); var sel = cm.listSelections().slice(0); sel[i] = {head: info.newPos, anchor: info.newPos}; cm.setSelections(sel); diff --git a/public/vendor/codemirror/addon/edit/continuelist.js b/public/vendor/codemirror/addon/edit/continuelist.js index e21d0f95..a0941d4f 100755 --- a/public/vendor/codemirror/addon/edit/continuelist.js +++ b/public/vendor/codemirror/addon/edit/continuelist.js @@ -11,8 +11,8 @@ })(function(CodeMirror) { "use strict"; - var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s|\[x\]\s|\s*)/, - emptyListRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s*|\[x\]\s|\s*)$/, + var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/, + emptyListRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/, unorderedListRE = /[*+-]\s/; CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { @@ -36,12 +36,11 @@ line: pos.line, ch: pos.ch + 1 }, "+delete"); replacements[i] = "\n"; - } else { - var indent = match[1], after = match[4]; + var indent = match[1], after = match[5]; var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 ? match[2] - : (parseInt(match[3], 10) + 1) + "."; + : (parseInt(match[3], 10) + 1) + match[4]; replacements[i] = "\n" + indent + bullet + after; } -- cgit v1.2.3