Skip to content

Commit 3850a52

Browse files
refactor to use statusLineHeight().
1 parent 333ca80 commit 3850a52

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/vtbackend/Terminal.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,10 +1056,7 @@ void Terminal::resizeScreenInternal(PageSize totalPageSize, std::optional<ImageS
10561056
{
10571057
// NOTE: This will only resize the currently active buffer.
10581058
// Any other buffer will be resized when it is switched to.
1059-
auto const statusLineHeight = _hostWritableStatusLineScreen.pageSize().lines;
1060-
auto const mainDisplayPageSize = _state.statusDisplayType == StatusDisplayType::None
1061-
? totalPageSize
1062-
: totalPageSize - statusLineHeight;
1059+
auto const mainDisplayPageSize = totalPageSize - statusLineHeight();
10631060

10641061
auto const oldMainDisplayPageSize = _settings.pageSize;
10651062

@@ -1692,10 +1689,7 @@ void Terminal::hardReset()
16921689
_hostWritableStatusLineScreen.clearScreen();
16931690
_hostWritableStatusLineScreen.updateCursorIterator();
16941691

1695-
auto const statusLineHeight = LineCount(1);
1696-
auto const mainDisplayPageSize = _state.statusDisplayType == StatusDisplayType::None
1697-
? _settings.pageSize
1698-
: _settings.pageSize - statusLineHeight;
1692+
auto const mainDisplayPageSize = _settings.pageSize - statusLineHeight();
16991693

17001694
_primaryScreen.margin() =
17011695
Margin { Margin::Vertical { {}, boxed_cast<LineOffset>(mainDisplayPageSize.lines) - 1 },
@@ -1761,10 +1755,7 @@ void Terminal::applyPageSizeToCurrentBuffer()
17611755

17621756
void Terminal::applyPageSizeToMainDisplay(ScreenType screenType)
17631757
{
1764-
auto const statusLineHeight = LineCount(1);
1765-
auto const mainDisplayPageSize = _state.statusDisplayType == StatusDisplayType::None
1766-
? _settings.pageSize
1767-
: _settings.pageSize - statusLineHeight;
1758+
auto const mainDisplayPageSize = _settings.pageSize - statusLineHeight();
17681759

17691760
// clang-format off
17701761
switch (screenType)

src/vtrasterizer/Renderer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ void Renderer::updateFontMetrics()
293293

294294
void Renderer::render(Terminal& terminal, bool pressure)
295295
{
296-
auto const statusLineHeight = terminal.state().statusDisplayType == StatusDisplayType::None
297-
? LineCount(0)
298-
: terminal.hostWritableStatusLineDisplay().pageSize().lines;
296+
auto const statusLineHeight = terminal.statusLineHeight();
299297
_gridMetrics.pageSize = terminal.pageSize() + statusLineHeight;
300298

301299
executeImageDiscards();

0 commit comments

Comments
 (0)