Update CodeMirror to 5.19.0 and rename jade to pug

This commit is contained in:
Wu Cheng-Han 2016-10-10 21:15:29 +08:00
parent fb5d7e4359
commit 795ea21191
30 changed files with 341 additions and 209 deletions

View file

@ -780,8 +780,12 @@
if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); }
if (keysAreChars) {
var here = cm.getCursor();
cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input');
var selections = cm.listSelections();
for (var i = 0; i < selections.length; i++) {
var here = selections[i].head;
cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input');
}
vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop();
}
clearInputState(cm);
return match.command;
@ -818,7 +822,7 @@
// TODO: Look into using CodeMirror's multi-key handling.
// Return no-op since we are caching the key. Counts as handled, but
// don't want act on it just yet.
return function() {};
return function() { return true; };
} else {
return function() {
return cm.operation(function() {
@ -4874,6 +4878,10 @@
if (changeObj.origin == '+input' || changeObj.origin == 'paste'
|| changeObj.origin === undefined /* only in testing */) {
var text = changeObj.text.join('\n');
if (lastChange.maybeReset) {
lastChange.changes = [];
lastChange.maybeReset = false;
}
lastChange.changes.push(text);
}
// Change objects may be chained with next.
@ -4896,7 +4904,7 @@
lastChange.expectCursorActivityForChange = false;
} else {
// Cursor moved outside the context of an edit. Reset the change.
lastChange.changes = [];
lastChange.maybeReset = true;
}
} else if (!cm.curOp.isVimOp) {
handleExternalSelection(cm, vim);
@ -4960,6 +4968,10 @@
var keyName = CodeMirror.keyName(e);
if (!keyName) { return; }
function onKeyFound() {
if (lastChange.maybeReset) {
lastChange.changes = [];
lastChange.maybeReset = false;
}
lastChange.changes.push(new InsertModeKey(keyName));
return true;
}