This commit is contained in:
Bruno Ribeito
2017-11-06 23:20:57 +00:00
parent b0020fc0ac
commit 1877e7019d
5 changed files with 35 additions and 11 deletions
+5 -1
View File
@@ -103,10 +103,14 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA
* @param ev The original right click event to be handled.
* @param textarea The terminal's textarea.
* @param selectionManager The terminal's selection manager.
* @param shouldSelectWord If true and there is no selection the current word will be selected
*/
export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, selectionManager: ISelectionManager): void {
export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, selectionManager: ISelectionManager, shouldSelectWord: boolean): void {
moveTextAreaUnderMouseCursor(ev, textarea);
if (shouldSelectWord && !selectionManager.hasSelection)
selectionManager.selectWordAtCursor(ev);
// Get textarea ready to copy from the context menu
textarea.value = selectionManager.selectionText;
textarea.select();