mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
@@ -627,9 +627,9 @@ struct AnsiDisplayState::Impl {
|
||||
size_t TargetColumn =
|
||||
((CursorColumn / DisplayTabWidth) + 1) * DisplayTabWidth;
|
||||
TargetColumn = std::min(TargetColumn, MaxDisplayColumnIndex);
|
||||
do {
|
||||
while (CursorColumn < TargetColumn) {
|
||||
WriteCharacter(" ");
|
||||
} while (CursorColumn < TargetColumn);
|
||||
}
|
||||
}
|
||||
|
||||
void SetCell(size_t Row, size_t Column, DisplayCell Cell) {
|
||||
|
||||
@@ -218,3 +218,12 @@ TEST_CASE("AnsiDisplayStateTest Utf8SplitAcrossApplyCallsWritesOneCell",
|
||||
CHECK(visitor.runs[0].columns == 1u);
|
||||
CHECK(visitor.runs[0].text == "X");
|
||||
}
|
||||
|
||||
TEST_CASE("AnsiDisplayState ignores tab at max column", "[AnsiDisplayState]") {
|
||||
mrc::AnsiDisplayState state;
|
||||
state.Apply("\x1b[4096GX\t");
|
||||
std::string snapshot = state.BuildSnapshot();
|
||||
|
||||
REQUIRE(snapshot.find("\x1b[1;4096HX") != std::string::npos);
|
||||
REQUIRE(snapshot.ends_with("\x1b[1;1H\x1b[s\x1b[1;4096H"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user