|
@@ -1646,7 +1646,7 @@ ErrorOr<void> Editor::reposition_cursor(Stream& stream, bool to_end)
|
|
|
|
|
|
ErrorOr<void> VT::move_absolute(u32 row, u32 col, Stream& stream)
|
|
|
{
|
|
|
- return stream.write_until_depleted(ByteString::formatted("\033[{};{}H", row, col).bytes());
|
|
|
+ return stream.write_until_depleted(ByteString::formatted("\033[{};{}H", row, col));
|
|
|
}
|
|
|
|
|
|
ErrorOr<void> VT::move_relative(int row, int col, Stream& stream)
|
|
@@ -1663,9 +1663,9 @@ ErrorOr<void> VT::move_relative(int row, int col, Stream& stream)
|
|
|
col = -col;
|
|
|
|
|
|
if (row > 0)
|
|
|
- TRY(stream.write_until_depleted(ByteString::formatted("\033[{}{}", row, x_op).bytes()));
|
|
|
+ TRY(stream.write_until_depleted(ByteString::formatted("\033[{}{}", row, x_op)));
|
|
|
if (col > 0)
|
|
|
- TRY(stream.write_until_depleted(ByteString::formatted("\033[{}{}", col, y_op).bytes()));
|
|
|
+ TRY(stream.write_until_depleted(ByteString::formatted("\033[{}{}", col, y_op)));
|
|
|
|
|
|
return {};
|
|
|
}
|
|
@@ -1812,10 +1812,9 @@ ErrorOr<void> VT::apply_style(Style const& style, Stream& stream, bool is_starti
|
|
|
style.italic() ? 3 : 23,
|
|
|
style.background().to_vt_escape(),
|
|
|
style.foreground().to_vt_escape(),
|
|
|
- style.hyperlink().to_vt_escape(true))
|
|
|
- .bytes()));
|
|
|
+ style.hyperlink().to_vt_escape(true))));
|
|
|
} else {
|
|
|
- TRY(stream.write_until_depleted(style.hyperlink().to_vt_escape(false).bytes()));
|
|
|
+ TRY(stream.write_until_depleted(style.hyperlink().to_vt_escape(false)));
|
|
|
}
|
|
|
|
|
|
return {};
|
|
@@ -1824,16 +1823,16 @@ ErrorOr<void> VT::apply_style(Style const& style, Stream& stream, bool is_starti
|
|
|
ErrorOr<void> VT::clear_lines(size_t count_above, size_t count_below, Stream& stream)
|
|
|
{
|
|
|
if (count_below + count_above == 0) {
|
|
|
- TRY(stream.write_until_depleted("\033[2K"sv.bytes()));
|
|
|
+ TRY(stream.write_until_depleted("\033[2K"sv));
|
|
|
} else {
|
|
|
// Go down count_below lines.
|
|
|
if (count_below > 0)
|
|
|
- TRY(stream.write_until_depleted(ByteString::formatted("\033[{}B", count_below).bytes()));
|
|
|
+ TRY(stream.write_until_depleted(ByteString::formatted("\033[{}B", count_below)));
|
|
|
// Then clear lines going upwards.
|
|
|
for (size_t i = count_below + count_above; i > 0; --i) {
|
|
|
- TRY(stream.write_until_depleted("\033[2K"sv.bytes()));
|
|
|
+ TRY(stream.write_until_depleted("\033[2K"sv));
|
|
|
if (i != 1)
|
|
|
- TRY(stream.write_until_depleted("\033[A"sv.bytes()));
|
|
|
+ TRY(stream.write_until_depleted("\033[A"sv));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1842,17 +1841,17 @@ ErrorOr<void> VT::clear_lines(size_t count_above, size_t count_below, Stream& st
|
|
|
|
|
|
ErrorOr<void> VT::save_cursor(Stream& stream)
|
|
|
{
|
|
|
- return stream.write_until_depleted("\033[s"sv.bytes());
|
|
|
+ return stream.write_until_depleted("\033[s"sv);
|
|
|
}
|
|
|
|
|
|
ErrorOr<void> VT::restore_cursor(Stream& stream)
|
|
|
{
|
|
|
- return stream.write_until_depleted("\033[u"sv.bytes());
|
|
|
+ return stream.write_until_depleted("\033[u"sv);
|
|
|
}
|
|
|
|
|
|
ErrorOr<void> VT::clear_to_end_of_line(Stream& stream)
|
|
|
{
|
|
|
- return stream.write_until_depleted("\033[K"sv.bytes());
|
|
|
+ return stream.write_until_depleted("\033[K"sv);
|
|
|
}
|
|
|
|
|
|
enum VTState {
|