fix ctrl+arrow bug in getline

This commit is contained in:
Adam D. Ruppe 2020-04-09 11:09:51 -04:00
parent 444eaa9759
commit d52eca78a2
1 changed files with 6 additions and 12 deletions

View File

@ -4905,12 +4905,9 @@ class LineGetter {
cursorPosition--; cursorPosition--;
} }
aligned(cursorPosition, -1); aligned(cursorPosition, -1);
if(!multiLineMode) {
if(cursorPosition < horizontalScrollPosition) { if(cursorPosition < horizontalScrollPosition)
horizontalScrollPosition--; positionCursor();
aligned(horizontalScrollPosition, -1);
}
}
redraw(); redraw();
break; break;
@ -4927,12 +4924,9 @@ class LineGetter {
cursorPosition = cast(int) line.length; cursorPosition = cast(int) line.length;
} }
aligned(cursorPosition, 1); aligned(cursorPosition, 1);
if(!multiLineMode) {
if(cursorPosition >= horizontalScrollPosition + availableLineLength()) { if(cursorPosition > horizontalScrollPosition + availableLineLength())
horizontalScrollPosition++; positionCursor();
aligned(horizontalScrollPosition, 1);
}
}
redraw(); redraw();
break; break;