Quick backspace fix
This commit is contained in:
@@ -87,11 +87,26 @@ void putchar(char c)
|
||||
return;
|
||||
}
|
||||
|
||||
// Improperly handled.
|
||||
// TODO: Improperly handled.
|
||||
// When we're on an empty line it should get to the upper line's last character
|
||||
// NOT just the last position possible; we would need to track the last line's character amount for that
|
||||
if (c == '\b')
|
||||
{
|
||||
cursor.x--;
|
||||
if (cursor.x == 0 && cursor.y == 0)
|
||||
{
|
||||
// Top-left corner
|
||||
return;
|
||||
}
|
||||
|
||||
if (cursor.x == 0)
|
||||
{
|
||||
cursor.y--;
|
||||
cursor.x = (framebuffer->width / FONT_WIDTH) -1; // here
|
||||
}
|
||||
else {
|
||||
cursor.x--;
|
||||
}
|
||||
|
||||
int px = cursor.x * FONT_WIDTH;
|
||||
int py = cursor.y * FONT_HEIGHT;
|
||||
erase_char(px, py);
|
||||
|
||||
Reference in New Issue
Block a user