impr: Add some help text to the pattern editor by default

This commit is contained in:
WerWolv
2025-11-30 14:08:21 +01:00
parent cba93e87eb
commit fa780e9706
2 changed files with 9 additions and 0 deletions

View File

@@ -304,6 +304,14 @@ namespace hex::plugin::builtin {
this->registerEvents();
this->registerMenuItems();
this->registerHandlers();
// Initialize the text editor with some basic help text
m_textEditor.setOnCreateCallback([](auto, ui::TextEditor &editor) {
std::string text = "hex.builtin.view.pattern_editor.default_help_text"_lang;
text = "// " + wolv::util::replaceStrings(text, "\n", "\n// ");
editor.setText(text);
});
}
ViewPatternEditor::~ViewPatternEditor() {