emacs code cleanup

This commit is contained in:
Robert Krahn 2013-02-19 12:26:05 -08:00
commit c76aed967f

View file

@ -363,10 +363,8 @@ exports.handler.addCommands({
// Any insertion or mouse click resets mark-mode. // Any insertion or mouse click resets mark-mode.
// setMark twice in a row at the same place resets markmode // setMark twice in a row at the same place resets markmode
var markMode = exports.markMode(); var markMode = exports.markMode();
if (markMode) { if (markMode) {
var cp = editor.getCursorPosition();
cp = editor.getCursorPosition();
if (editor.selection.isEmpty() && if (editor.selection.isEmpty() &&
markMode.row == cp.row && markMode.column == cp.column) { markMode.row == cp.row && markMode.column == cp.column) {
exports.setMarkMode(null); exports.setMarkMode(null);
@ -374,7 +372,6 @@ exports.handler.addCommands({
return; return;
} }
} }
// turn on mark mode // turn on mark mode
markMode = editor.getCursorPosition(); markMode = editor.getCursorPosition();
exports.setMarkMode(markMode); exports.setMarkMode(markMode);
@ -384,7 +381,6 @@ exports.handler.addCommands({
exchangePointAndMark: { exchangePointAndMark: {
exec: function(editor) { exec: function(editor) {
var range = editor.selection.getRange(); var range = editor.selection.getRange();
editor.selection.setSelectionRange(range, !editor.selection.isBackwards()); editor.selection.setSelectionRange(range, !editor.selection.isBackwards());
}, },
readonly: true, readonly: true,