emacs: C-u C-x C-x fix (exchangePointAndMark)

This commit is contained in:
Robert Krahn 2013-05-26 21:04:34 -07:00
commit 0ea9428cd8

View file

@ -458,17 +458,25 @@ exports.handler.addCommands({
multiSelectAction: "forEach"
},
exchangePointAndMark: {
exec: function(editor) {
exec: function(editor, args) {
var sel = editor.selection;
if (args.count) {
var pos = editor.getCursorPosition();
sel.clearSelection();
sel.moveCursorToPosition(editor.popEmacsMark());
editor.pushEmacsMark(pos);
return;
}
var lastMark = editor.getLastEmacsMark();
var range = sel.getRange();
if (range.isEmpty()) {
var lastMark = editor.getLastEmacsMark();
sel.selectToPosition(lastMark);
return;
}
editor.selection.setSelectionRange(range, !editor.selection.isBackwards());
sel.setSelectionRange(range, !sel.isBackwards());
},
readonly: true,
handlesCount: true,
multiSelectAction: "forEach"
},
killWord: {