Skip to content

Commit

Permalink
Fix crush when status line is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Jun 18, 2024
1 parent 121d7ad commit 6e51ef5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<li>Fixes bad wording of OS/X to macOS (#1462)</li>
<li>Fixes key bindings and search prompt collision (#1472)</li>
<li>Fixes `CSI 8 ; (COLS) ; (ROWS) t` to resize the terminal with respect to High-DPI</li>
<li>Fixes status line crush (#1511)</li>
</ul>
</description>
</release>
Expand Down
18 changes: 11 additions & 7 deletions src/vtbackend/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,20 +1253,24 @@ struct LocalSequenceHandler // {{{
instructionCounter = 0;
targetScreen.processSequence(seq);
}

void writeText(char32_t codepoint)
{
instructionCounter++;
targetScreen.writeText(codepoint);
}

[[nodiscard]] size_t writeText(std::string_view chars, size_t cellCount)
[[nodiscard]] size_t writeText(std::string_view chars, size_t)
{
assert(!chars.empty());
instructionCounter += chars.size();
targetScreen.writeText(chars, cellCount);
return terminal.settings().pageSize.columns.as<size_t>()
- terminal.currentScreen().cursor().position.column.as<size_t>();
// implementation of targetScreen.writeText(chars, cellCount)
// is buggy and does not work correctly
// so we do not use optimization for
// ParserEvents::print(chars,cellCount)
// but write char by char
// TODO fix targetScreen.writeText(chars, cellCount)
for (auto c: chars)
targetScreen.writeText(c);

return 0;
}

void writeTextEnd() { targetScreen.writeTextEnd(); }
Expand Down

0 comments on commit 6e51ef5

Please sign in to comment.