mirror of https://github.com/adamdruppe/arsd.git
fix bug with horizontal scroll and esc key
This commit is contained in:
parent
d15e54278e
commit
96bb12d2a6
|
@ -4353,6 +4353,7 @@ class LineGetter {
|
||||||
case KeyboardEvent.Key.escape:
|
case KeyboardEvent.Key.escape:
|
||||||
justHitTab = false;
|
justHitTab = false;
|
||||||
cursorPosition = 0;
|
cursorPosition = 0;
|
||||||
|
horizontalScrollPosition = 0;
|
||||||
line = line[0 .. 0];
|
line = line[0 .. 0];
|
||||||
line.assumeSafeAppend();
|
line.assumeSafeAppend();
|
||||||
redraw();
|
redraw();
|
||||||
|
@ -4366,6 +4367,8 @@ class LineGetter {
|
||||||
line = editLineInEditor(line, cursorPosition);
|
line = editLineInEditor(line, cursorPosition);
|
||||||
if(cursorPosition > line.length)
|
if(cursorPosition > line.length)
|
||||||
cursorPosition = cast(int) line.length;
|
cursorPosition = cast(int) line.length;
|
||||||
|
if(horizontalScrollPosition > line.length)
|
||||||
|
horizontalScrollPosition = cast(int) line.length;
|
||||||
positionCursor();
|
positionCursor();
|
||||||
redraw();
|
redraw();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue