From e123dd1849b63fd15cdead4d7ec89774180e799e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 3 Sep 2017 21:15:14 -0700 Subject: [PATCH] Null check if clicking on scroll bar --- src/SelectionManager.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index e84bde68..4fe09c8c 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -409,6 +409,11 @@ export class SelectionManager extends EventEmitter implements ISelectionManager return; } + // Return early if the click event is not in the buffer (eg. in scroll bar) + if (line.length >= this._model.selectionStart[0]) { + return; + } + // If the mouse is over the second half of a wide character, adjust the // selection to cover the whole character const char = line[this._model.selectionStart[0]];