Merge pull request #2155 from ajaxorg/keyboard/emacs
fix #2154 Emacs copy/paste issue with highlighting marker
This commit is contained in:
commit
0989419251
1 changed files with 9 additions and 6 deletions
|
|
@ -300,9 +300,12 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
|
|||
if (!command) return undefined;
|
||||
}
|
||||
|
||||
if (!command.readonly && !command.isYank)
|
||||
if (!command.readOnly && !command.isYank)
|
||||
data.lastCommand = null;
|
||||
|
||||
if (!command.readOnly && editor.emacsMark())
|
||||
editor.setEmacsMark(null)
|
||||
|
||||
if (data.count) {
|
||||
var count = data.count;
|
||||
data.count = 0;
|
||||
|
|
@ -384,7 +387,7 @@ exports.emacsKeys = {
|
|||
"M-y": "yankRotate",
|
||||
"C-g": "keyboardQuit",
|
||||
|
||||
"C-w": "killRegion",
|
||||
"C-w|C-S-W": "killRegion",
|
||||
"M-w": "killRingSave",
|
||||
"C-Space": "setMark",
|
||||
"C-x C-x": "exchangePointAndMark",
|
||||
|
|
@ -466,7 +469,7 @@ exports.handler.addCommands({
|
|||
editor.setEmacsMark(mark);
|
||||
editor.selection.setSelectionAnchor(mark.row, mark.column);
|
||||
},
|
||||
readonly: true,
|
||||
readOnly: true,
|
||||
handlesCount: true,
|
||||
multiSelectAction: "forEach"
|
||||
},
|
||||
|
|
@ -488,7 +491,7 @@ exports.handler.addCommands({
|
|||
}
|
||||
sel.setSelectionRange(range, !sel.isBackwards());
|
||||
},
|
||||
readonly: true,
|
||||
readOnly: true,
|
||||
handlesCount: true,
|
||||
multiSelectAction: "forEach"
|
||||
},
|
||||
|
|
@ -547,7 +550,7 @@ exports.handler.addCommands({
|
|||
exports.killRing.add(editor.getCopyText());
|
||||
editor.commands.byName.cut.exec(editor);
|
||||
},
|
||||
readonly: true,
|
||||
readOnly: true,
|
||||
multiSelectAction: "forEach"
|
||||
},
|
||||
killRingSave: {
|
||||
|
|
@ -560,7 +563,7 @@ exports.handler.addCommands({
|
|||
sel.clearSelection();
|
||||
}, 0);
|
||||
},
|
||||
readonly: true
|
||||
readOnly: true
|
||||
},
|
||||
keyboardQuit: function(editor) {
|
||||
editor.selection.clearSelection();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue