diff --git a/src/handlers/Clipboard.test.ts b/src/handlers/Clipboard.test.ts index 3302cb6c..09374694 100644 --- a/src/handlers/Clipboard.test.ts +++ b/src/handlers/Clipboard.test.ts @@ -5,7 +5,7 @@ import * as Clipboard from './Clipboard'; describe('evaluateCopiedTextProcessing', function () { it('should strip trailing whitespaces and replace nbsps with spaces', function () { - var nonBreakingSpace = String.fromCharCode(160), + let nonBreakingSpace = String.fromCharCode(160), copiedText = 'echo' + nonBreakingSpace + 'hello' + nonBreakingSpace, processedText = Clipboard.prepareTextForClipboard(copiedText); diff --git a/src/handlers/Clipboard.ts b/src/handlers/Clipboard.ts index e4967598..073310bf 100644 --- a/src/handlers/Clipboard.ts +++ b/src/handlers/Clipboard.ts @@ -108,11 +108,11 @@ export function rightClickHandler(ev: MouseEvent, term: ITerminal) { if (s.rangeCount) { let r = s.getRangeAt(0), - cr = r.getClientRects(), - i, rect; + cr = r.getClientRects(); + + for (let i = 0; i < cr.length; i++) { + let rect = cr[i]; - for (i=0; i rect.left) && (x < rect.right) && (y > rect.top) && (y < rect.bottom)