From 7e0a4840004cbea7c3efd73d67cf080e17554c7a Mon Sep 17 00:00:00 2001 From: npezza93 Date: Mon, 23 Oct 2017 19:49:39 -0400 Subject: [PATCH] Handle going back and up in the alt buffer from a long line to a short line --- src/handlers/AltClickHandler.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/handlers/AltClickHandler.ts b/src/handlers/AltClickHandler.ts index 827e9fdc..42fdc443 100644 --- a/src/handlers/AltClickHandler.ts +++ b/src/handlers/AltClickHandler.ts @@ -39,8 +39,14 @@ export class AltClickHandler { if (this._terminal.buffer === this._terminal.buffers.normal) { keyboardArrows = this.buildArrowSequence(this.normalCharCount(), this.horizontalCursorCommand(this.normalMoveForward())); } else { - keyboardArrows = this.buildArrowSequence(this.altVerticalCharCount(), this.verticalCursorCommand(this.altMoveUpward())); - keyboardArrows += this.buildArrowSequence(this.altHorizontalCharCount(), this.horizontalCursorCommand(this.altMoveForward())); + let verticalChars = this.buildArrowSequence(this.altVerticalCharCount(), this.verticalCursorCommand(this.altMoveUpward())); + let horizontalChars = this.buildArrowSequence(this.altHorizontalCharCount(), this.horizontalCursorCommand(this.altMoveForward())); + + if (this.altMoveForward()) { + keyboardArrows = verticalChars + horizontalChars + } else { + keyboardArrows = horizontalChars + verticalChars + } } this._terminal.send(keyboardArrows);