fix bug with horizontal scroll and esc key

This commit is contained in:
Adam D. Ruppe 2020-03-04 16:59:03 -05:00
parent d15e54278e
commit 96bb12d2a6
1 changed files with 3 additions and 0 deletions

View File

@ -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;