From f61d852f3c333369b860f1f853cc95e4c64c39ee Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 6 Jun 2017 15:05:22 -0700 Subject: [PATCH] Don't allow double click selection on empty row going out of viewport --- src/SelectionManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index 112ec4a7..28e08cc1 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -459,7 +459,7 @@ export class SelectionManager extends EventEmitter { // Record the resulting selection this._model.selectionStart = [startIndex + charOffset - leftWideCharCount, coords[1]]; - this._model.selectionStartLength = endIndex - startIndex + leftWideCharCount + rightWideCharCount + 1/*include endIndex char*/; + this._model.selectionStartLength = Math.min(endIndex - startIndex + leftWideCharCount + rightWideCharCount + 1/*include endIndex char*/, this._terminal.cols); } private _selectLineAt(line: number): void {