Skip to content

Commit

Permalink
Merge pull request #156071 from MonadChains/selection-bug
Browse files Browse the repository at this point in the history
Fix selection when reach boundaries of the terminal
  • Loading branch information
Tyriar authored and joyceerhl committed Aug 10, 2022
2 parents 272fe25 + 58ac974 commit c9a08fb
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ export class CommandNavigationAddon extends Disposable implements ICommandTracke
// Clear the current marker so successive focus/selection actions are performed from the
// bottom of the buffer
this._currentMarker = Boundary.Bottom;
this._resetNavigationDecoration();
this._selectionStart = null;
}

private _resetNavigationDecoration() {
this._navigationDecoration?.dispose();
this._navigationDecoration = undefined;
this._selectionStart = null;
}

scrollToPreviousCommand(scrollPosition: ScrollPosition = ScrollPosition.Middle, retainSelection: boolean = false): void {
Expand Down Expand Up @@ -112,7 +116,7 @@ export class CommandNavigationAddon extends Disposable implements ICommandTracke
if (markerIndex < 0) {
this._currentMarker = Boundary.Top;
this._terminal.scrollToTop();
this.clearMarker();
this._resetNavigationDecoration();
return;
}

Expand Down Expand Up @@ -154,7 +158,7 @@ export class CommandNavigationAddon extends Disposable implements ICommandTracke
if (markerIndex >= this._getCommandMarkers().length) {
this._currentMarker = Boundary.Bottom;
this._terminal.scrollToBottom();
this.clearMarker();
this._resetNavigationDecoration();
return;
}

Expand Down

0 comments on commit c9a08fb

Please sign in to comment.