From 96bb12d2a6337b2ffc392b3be0835ca446763741 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Wed, 4 Mar 2020 16:59:03 -0500 Subject: [PATCH] fix bug with horizontal scroll and esc key --- terminal.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terminal.d b/terminal.d index 1915e81..108b75b 100644 --- a/terminal.d +++ b/terminal.d @@ -4353,6 +4353,7 @@ class LineGetter { case KeyboardEvent.Key.escape: justHitTab = false; cursorPosition = 0; + horizontalScrollPosition = 0; line = line[0 .. 0]; line.assumeSafeAppend(); redraw(); @@ -4366,6 +4367,8 @@ class LineGetter { line = editLineInEditor(line, cursorPosition); if(cursorPosition > line.length) cursorPosition = cast(int) line.length; + if(horizontalScrollPosition > line.length) + horizontalScrollPosition = cast(int) line.length; positionCursor(); redraw(); break;