Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
correctly exit linked mode when up arrow pressed
  • Loading branch information
aclement committed Jan 26, 2012
1 parent b480e19 commit 4c1bbb9
Showing 1 changed file with 13 additions and 7 deletions.
Expand Up @@ -928,16 +928,20 @@ function(mUndoStack, mKeyBinding, mRulers, mAnnotations, mTextDND, mRegex) {
isStatusActive: function() {
return this.linkedModeActive;
},
lineUp: function() {
this.cancel(false);
return false;
},
lineDown: function() {
this.cancel();
return true;
this.cancel(true);
return true;
},
enter: function() {
this.cancel();
this.cancel(true);
return true;
},
/** Exits Linked Mode. Places the caret at linkedModeEscapePosition. */
cancel: function() {
/** Exits Linked Mode. Optionally places the caret at linkedModeEscapePosition. */
cancel: function(placeCaret) {
if (!this.linkedModeActive) {
return;
}
Expand All @@ -946,8 +950,10 @@ function(mUndoStack, mKeyBinding, mRulers, mAnnotations, mTextDND, mRegex) {
this.textView.setKeyBinding(new mKeyBinding.KeyBinding(9), "tab");
this.textView.setKeyBinding(new mKeyBinding.KeyBinding(9, false, true), null);

this.textView.setCaretOffset(this.linkedModeEscapePosition, false);

if (placeCaret===true) {
this.textView.setCaretOffset(this.linkedModeEscapePosition, false);
}

this.editor.reportStatus("Linked Mode exited");
},
/**
Expand Down

0 comments on commit 4c1bbb9

Please sign in to comment.