Hang on to selection state to avoid redrawing

This commit is contained in:
Daniel Imms
2017-08-31 00:13:49 -07:00
parent 3d1bb2c60f
commit d601f0aec2
2 changed files with 4 additions and 1 deletions
-1
View File
@@ -311,7 +311,6 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
* @param event The mousedown event.
*/
public onMouseDown(event: MouseEvent): void {
console.log('mousedown selectionmanager');
// If we have selection, we want the context menu on right click even if the
// terminal is in mouse mode.
if (event.button === 2 && this.hasSelection) {
+4
View File
@@ -73,5 +73,9 @@ export class SelectionRenderLayer implements ISelectionRenderLayer {
const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : terminal.cols;
this._ctx.fillRect(0, viewportCappedEndRow * scaledCharHeight, endCol * scaledCharWidth, scaledCharHeight);
}
// Save state for next render
this._state.start = [start[0], start[1]];
this._state.end = [end[0], end[1]];
}
}