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 Apr 16, 2024
1 parent f18103b commit 6d8408b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/vtbackend/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,20 +1250,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)

Check warning on line 1259 in src/vtbackend/Terminal.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy-review

clang-tidy

warning: all parameters should be named in a function [readability-named-parameter] ```suggestion [[nodiscard]] size_t writeText(std::string_view chars, size_t /*unused*/) ```
{
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)

Check warning on line 1267 in src/vtbackend/Terminal.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy-review

clang-tidy

warning: variable name 'c' is too short, expected at least 3 characters [readability-identifier-length] ```cpp for (auto c: chars) ^ ```
targetScreen.writeText(c);

Check warning on line 1268 in src/vtbackend/Terminal.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy-review

clang-tidy

warning: statement should be inside braces [readability-braces-around-statements] ```suggestion for (auto c: chars) { targetScreen.writeText(c); } ```

return 0;
}

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

0 comments on commit 6d8408b

Please sign in to comment.