mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibVT: Implement DECFI
and DECBI
These escape sequences are the horizontal scrolling equivalents of `IND` and `RI`. Normally, they move the cursor forward or backward. But if they hit the margins (which we just treat as the first and last columns), they scroll the line. Another VT420 feature done.
This commit is contained in:
parent
89843cd692
commit
13991eade7
Notes:
sideshowbarker
2024-07-18 12:29:46 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/13991eade72 Pull-request: https://github.com/SerenityOS/serenity/pull/7698
|
@ -888,6 +888,22 @@ void Terminal::RI()
|
|||
set_cursor(cursor_row() - 1, cursor_column());
|
||||
}
|
||||
|
||||
void Terminal::DECFI()
|
||||
{
|
||||
if (cursor_column() == columns() - 1)
|
||||
scroll_left(cursor_row(), 0, 1);
|
||||
else
|
||||
set_cursor(cursor_row(), cursor_column() + 1);
|
||||
}
|
||||
|
||||
void Terminal::DECBI()
|
||||
{
|
||||
if (cursor_column() == 0)
|
||||
scroll_right(cursor_row(), 0, 1);
|
||||
else
|
||||
set_cursor(cursor_row(), cursor_column() - 1);
|
||||
}
|
||||
|
||||
void Terminal::DSR(Parameters params)
|
||||
{
|
||||
if (params.size() == 1 && params[0] == 5) {
|
||||
|
@ -991,12 +1007,18 @@ void Terminal::execute_escape_sequence(Intermediates intermediates, bool ignore,
|
|||
case '\\':
|
||||
// ST (string terminator) -- do nothing
|
||||
return;
|
||||
case '6':
|
||||
DECBI();
|
||||
return;
|
||||
case '7':
|
||||
DECSC();
|
||||
return;
|
||||
case '8':
|
||||
DECRC();
|
||||
return;
|
||||
case '9':
|
||||
DECFI();
|
||||
return;
|
||||
}
|
||||
} else if (intermediates[0] == '#') {
|
||||
switch (last_byte) {
|
||||
|
|
|
@ -304,6 +304,12 @@ protected:
|
|||
// RI - Reverse Index (move up)
|
||||
void RI();
|
||||
|
||||
// DECBI - Back Index
|
||||
void DECBI();
|
||||
|
||||
// DECFI - Forward Index
|
||||
void DECFI();
|
||||
|
||||
// DSR - Device Status Reports
|
||||
void DSR(Parameters);
|
||||
|
||||
|
|
Loading…
Reference in a new issue