diff options
author | Wu Cheng-Han | 2015-07-04 11:31:01 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2015-07-04 11:31:01 +0800 |
commit | 01685c255fda6e13f1cd2980130d2e388d52125c (patch) | |
tree | c329610e7011c0d77c55ef54f371181aeb362d13 /public/vendor/codemirror/addon/edit | |
parent | 1d843c8ac257d512a96cf054ab24e6a3c2f34e26 (diff) |
Updated codemirror to 5.4.0
Diffstat (limited to 'public/vendor/codemirror/addon/edit')
-rwxr-xr-x | public/vendor/codemirror/addon/edit/closebrackets.js | 1 | ||||
-rwxr-xr-x | public/vendor/codemirror/addon/edit/closetag.js | 2 | ||||
-rwxr-xr-x | public/vendor/codemirror/addon/edit/continuelist.js | 9 |
3 files changed, 6 insertions, 6 deletions
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; } |