fix: Pattern Editor shortcuts not working correctly on different languages (#2085)

Fixes #2084 

Error in text editor prevented using shortcuts when language other than
English was chosen.

The code was mistakenly using localized name to test which window had
focus a execute the shortcut.

Fixed it by switching the name of the child window to the constant value
used to check the windows focused identity.
This commit is contained in:
paxcut
2025-01-25 08:34:27 -07:00
committed by GitHub
parent b646ece14b
commit 048c483903
2 changed files with 3 additions and 3 deletions

View File

@@ -24,12 +24,12 @@ namespace pl::ptrn { class Pattern; }
namespace hex::plugin::builtin {
constexpr static auto textEditorView = "/Pattern editor_";
constexpr static auto textEditorView = "/##pattern_editor_";
constexpr static auto consoleView = "/##console_";
constexpr static auto variablesView = "/##env_vars_";
constexpr static auto settingsView = "/##settings_";
constexpr static auto sectionsView = "/##sections_table_";
constexpr static auto virtualFilesView = "/Virtual File Tree_";
constexpr static auto virtualFilesView = "/##Virtual_File_Tree_";
constexpr static auto debuggerView = "/##debugger_";
class PatternSourceCode {

View File

@@ -344,7 +344,7 @@ namespace hex::plugin::builtin {
}
ImGui::PushFont(fonts::CodeEditor());
m_textEditor.Render("hex.builtin.view.pattern_editor.name"_lang, textEditorSize, false);
m_textEditor.Render("##pattern_editor", textEditorSize, false);
ImGui::PopFont();
m_textEditorHoverBox = ImRect(windowPosition,windowPosition+textEditorSize);