Small clean up
This commit is contained in:
@@ -257,7 +257,9 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (start[1] < coords[1] && end[1] > coords[1]) || (start[1] === coords[1] && coords[0] > start[0]) || (end[1] === coords[1] && coords[0] < end[0]);
|
return (start[1] < coords[1] && end[1] > coords[1]) ||
|
||||||
|
(start[1] === coords[1] && coords[0] > start[0]) ||
|
||||||
|
(end[1] === coords[1] && coords[0] < end[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -121,8 +121,9 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA
|
|||||||
export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, selectionManager: ISelectionManager, shouldSelectWord: boolean): void {
|
export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, selectionManager: ISelectionManager, shouldSelectWord: boolean): void {
|
||||||
moveTextAreaUnderMouseCursor(ev, textarea);
|
moveTextAreaUnderMouseCursor(ev, textarea);
|
||||||
|
|
||||||
if (shouldSelectWord && !selectionManager.isClickInSelection(ev))
|
if (shouldSelectWord && !selectionManager.isClickInSelection(ev)) {
|
||||||
selectionManager.selectWordAtCursor(ev);
|
selectionManager.selectWordAtCursor(ev);
|
||||||
|
}
|
||||||
|
|
||||||
// Get textarea ready to copy from the context menu
|
// Get textarea ready to copy from the context menu
|
||||||
textarea.value = selectionManager.selectionText;
|
textarea.value = selectionManager.selectionText;
|
||||||
|
|||||||
Reference in New Issue
Block a user