Refactor scrolling logic for GUIRenderer and terminal to improve synchronization and cursor visibility.

This commit is contained in:
2025-12-02 02:43:05 -08:00
parent 0bfe75fbf0
commit cd33e8feb1
5 changed files with 119 additions and 124 deletions

View File

@@ -32,6 +32,16 @@ public:
}
[[nodiscard]] std::size_t ContentRows() const
{
// Always compute from current rows_ to avoid stale values.
// Reserve 1 row for status line.
if (rows_ == 0)
return 1;
return std::max<std::size_t>(1, rows_ - 1);
}
// Mode and flags (mirroring legacy fields)
void SetMode(int m)
{
@@ -553,4 +563,4 @@ private:
std::string replace_with_tmp_;
};
#endif // KTE_EDITOR_H
#endif // KTE_EDITOR_H