1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibVT: Let Terminal only expose history_size, not storage

This commit is contained in:
Nico Weber 2020-09-09 18:49:21 -04:00 committed by Andreas Kling
parent 927e2fc6bc
commit 90d9c83067
2 changed files with 4 additions and 4 deletions

View file

@ -274,11 +274,11 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
invalidate_cursor();
int rows_from_history = 0;
int first_row_from_history = m_terminal.history().size();
int first_row_from_history = m_terminal.history_size();
int row_with_cursor = m_terminal.cursor_row();
if (m_scrollbar->value() != m_scrollbar->max()) {
rows_from_history = min((int)m_terminal.rows(), m_scrollbar->max() - m_scrollbar->value());
first_row_from_history = m_terminal.history().size() - (m_scrollbar->max() - m_scrollbar->value());
first_row_from_history = m_terminal.history_size() - (m_scrollbar->max() - m_scrollbar->value());
row_with_cursor = m_terminal.cursor_row() + rows_from_history;
}
@ -742,7 +742,7 @@ int TerminalWidget::last_selection_column_on_row(int row) const
void TerminalWidget::terminal_history_changed()
{
bool was_max = m_scrollbar->value() == m_scrollbar->max();
m_scrollbar->set_max(m_terminal.history().size());
m_scrollbar->set_max(m_terminal.history_size());
if (was_max)
m_scrollbar->set_value(m_scrollbar->max());
m_scrollbar->update();