diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index 991fa6bb..ce4c0f22 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -238,12 +238,16 @@ export class SelectionManager extends EventEmitter { this._setMouseClickCount(); console.log(this._clickCount); - if (this._clickCount === 1) { - this._onSingleClick(event); - } else if (this._clickCount === 2) { - this._onDoubleClick(event); - } else if (this._clickCount === 3) { - this._onTripleClick(event); + if (event.shiftKey) { + this._onShiftClick(event); + } else { + if (this._clickCount === 1) { + this._onSingleClick(event); + } else if (this._clickCount === 2) { + this._onDoubleClick(event); + } else if (this._clickCount === 3) { + this._onTripleClick(event); + } } // Listen on the document so that dragging outside of viewport works @@ -253,6 +257,12 @@ export class SelectionManager extends EventEmitter { this.refresh(); } + private _onShiftClick(event: MouseEvent): void { + if (this._model.selectionStart) { + this._model.selectionEnd = this._getMouseBufferCoords(event); + } + } + private _onSingleClick(event: MouseEvent): void { this._model.selectionStartLength = 0; this._model.isSelectAllActive = false;