mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:47:35 +00:00
Terminal: Store horizontal tabs in a Vector.
There's no need to muck around with manual malloc()/free() here.
This commit is contained in:
parent
ecb72dd991
commit
e8f35ef311
2 changed files with 2 additions and 5 deletions
|
@ -104,7 +104,6 @@ void Terminal::Line::clear(Attribute attribute)
|
||||||
|
|
||||||
Terminal::~Terminal()
|
Terminal::~Terminal()
|
||||||
{
|
{
|
||||||
free(m_horizontal_tabs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Terminal::clear()
|
void Terminal::clear()
|
||||||
|
@ -889,9 +888,7 @@ void Terminal::set_size(word columns, word rows)
|
||||||
m_saved_cursor_row = 0;
|
m_saved_cursor_row = 0;
|
||||||
m_saved_cursor_column = 0;
|
m_saved_cursor_column = 0;
|
||||||
|
|
||||||
if (m_horizontal_tabs)
|
m_horizontal_tabs.resize(columns);
|
||||||
free(m_horizontal_tabs);
|
|
||||||
m_horizontal_tabs = static_cast<byte*>(malloc(columns));
|
|
||||||
for (unsigned i = 0; i < columns; ++i)
|
for (unsigned i = 0; i < columns; ++i)
|
||||||
m_horizontal_tabs[i] = (i % 8) == 0;
|
m_horizontal_tabs[i] = (i % 8) == 0;
|
||||||
// Rightmost column is always last tab on line.
|
// Rightmost column is always last tab on line.
|
||||||
|
|
|
@ -176,8 +176,8 @@ private:
|
||||||
Vector<byte> m_intermediates;
|
Vector<byte> m_intermediates;
|
||||||
Vector<byte> m_xterm_param1;
|
Vector<byte> m_xterm_param1;
|
||||||
Vector<byte> m_xterm_param2;
|
Vector<byte> m_xterm_param2;
|
||||||
|
Vector<bool> m_horizontal_tabs;
|
||||||
byte m_final { 0 };
|
byte m_final { 0 };
|
||||||
byte* m_horizontal_tabs { nullptr };
|
|
||||||
bool m_belling { false };
|
bool m_belling { false };
|
||||||
|
|
||||||
int m_pixel_width { 0 };
|
int m_pixel_width { 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue