fix: horizontal scrollbar missing in console (#2253)

The recent changes to the text editor to fix the longest line length
problems broke the console horizontal scrollbar. The code that displays
the console editor was more complicated that it needed be, and it had
the bad side effect of resetting the cursor which prevented horizontal
scrolling. Adding a function that appends lines to the text editor fixes
all problems and makes the code clearer. To accommodate for strings
containing zeros, the code that inserts text was changed to print a '.'
when zeros are encountered thus keeping the line length the same.
This commit is contained in:
paxcut
2025-05-17 00:23:43 -07:00
committed by GitHub
parent e32c5784af
commit d263962a06
4 changed files with 38 additions and 21 deletions

View File

@@ -261,6 +261,7 @@ namespace hex::plugin::builtin {
PerProvider<TextEditor::Coordinates> m_consoleCursorPosition;
PerProvider<TextEditor::Selection> m_selection;
PerProvider<TextEditor::Selection> m_consoleSelection;
PerProvider<size_t> m_consoleLongestLineLength;
PerProvider<TextEditor::Breakpoints> m_breakpoints;
PerProvider<std::optional<pl::core::err::PatternLanguageError>> m_lastEvaluationError;
PerProvider<std::vector<pl::core::err::CompileError>> m_lastCompileError;