From 6822070222945574d4b017b4bb80b725e133a255 Mon Sep 17 00:00:00 2001 From: Bruno Ribeito Date: Sun, 12 Nov 2017 23:15:09 +0000 Subject: [PATCH] Fix typo + Cleanup logic --- src/Interfaces.ts | 1 - src/SelectionManager.ts | 1 + src/handlers/Clipboard.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Interfaces.ts b/src/Interfaces.ts index 69e7fcb2..39b81baf 100644 --- a/src/Interfaces.ts +++ b/src/Interfaces.ts @@ -195,7 +195,6 @@ export interface ISelectionManager { selectionText: string; selectionStart: [number, number]; selectionEnd: [number, number]; - hasSelection: boolean; disable(): void; enable(): void; diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index 3bf366ce..7e04119e 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -280,6 +280,7 @@ export class SelectionManager extends EventEmitter implements ISelectionManager this.refresh(true); } } + } /** * Selects all text within the terminal. diff --git a/src/handlers/Clipboard.ts b/src/handlers/Clipboard.ts index 6814d269..f110ed1f 100644 --- a/src/handlers/Clipboard.ts +++ b/src/handlers/Clipboard.ts @@ -108,7 +108,7 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, selectionManager: ISelectionManager, shouldSelectWord: boolean): void { moveTextAreaUnderMouseCursor(ev, textarea); - if (shouldSelectWord && (!selectionManager.hasSelection || !selectionManager.isClickInSelection(ev))) + if (shouldSelectWord && !selectionManager.isClickInSelection(ev)) selectionManager.selectWordAtCursor(ev); // Get textarea ready to copy from the context menu