1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:37:44 +00:00

LibVT+Terminal: Implement line wrapping

This commit implements line wrapping in the terminal, and tries its best
to move the cursor to the "correct" position.
This commit is contained in:
Ali Mohammad Pur 2021-06-19 03:53:03 +04:30 committed by Andreas Kling
parent 424965954f
commit 2f2b7814d1
5 changed files with 206 additions and 22 deletions

View file

@ -51,4 +51,15 @@ private:
int m_column { -1 };
};
struct CursorPosition {
u16 row { 0 };
u16 column { 0 };
void clamp(u16 max_row, u16 max_column)
{
row = min(row, max_row);
column = min(column, max_column);
}
};
}