From a4ee7236651564dcde2554c0968f5fae0c996126 Mon Sep 17 00:00:00 2001 From: npezza93 Date: Sat, 27 Jan 2018 22:06:58 -0500 Subject: [PATCH] Fix backward row/col definition --- src/handlers/AltClickHandler.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/handlers/AltClickHandler.ts b/src/handlers/AltClickHandler.ts index 829daf97..bddde6fb 100644 --- a/src/handlers/AltClickHandler.ts +++ b/src/handlers/AltClickHandler.ts @@ -172,32 +172,32 @@ export class AltClickHandler { endCol: number, endRow: number, forward: boolean): string { - let currentRow = startCol; - let currentCol = startRow; + let currentCol = startCol; + let currentRow = startRow; let bufferStr = ''; - while (currentRow !== endCol || (currentCol !== endRow)) { - currentRow += forward ? 1 : -1; + while (currentCol !== endCol || currentRow !== endRow) { + currentCol += forward ? 1 : -1; - if (forward && currentRow > this._terminal.cols - 1) { + if (forward && currentCol > this._terminal.cols - 1) { bufferStr += this._terminal.buffer.translateBufferLineToString( - currentCol, false, startCol, currentRow + currentRow, false, startCol, currentCol ); - currentRow = 0; + currentCol = 0; startCol = 0; - currentCol++; - } else if (!forward && currentRow < 0) { + currentRow++; + } else if (!forward && currentCol < 0) { bufferStr += this._terminal.buffer.translateBufferLineToString( - currentCol, false, 0, startCol + 1 + currentRow, false, 0, startCol + 1 ); - currentRow = this._terminal.cols - 1; - startCol = currentRow; - currentCol--; + currentCol = this._terminal.cols - 1; + startCol = currentCol; + currentRow--; } } return bufferStr + this._terminal.buffer.translateBufferLineToString( - currentCol, false, startCol, currentRow + currentRow, false, startCol, currentCol ); }