diff --git a/plugins/builtin/source/content/command_palette_commands.cpp b/plugins/builtin/source/content/command_palette_commands.cpp index d3fed49c9..c12b8e464 100644 --- a/plugins/builtin/source/content/command_palette_commands.cpp +++ b/plugins/builtin/source/content/command_palette_commands.cpp @@ -28,9 +28,9 @@ namespace hex::plugin::builtin { if (result.has_value()) - return hex::format("#{0} = %{1}", input.data(), result.value()); + return hex::format("#{0} = {1}", input.data(), result.value()); else - return hex::format("#{0} = ???", input.data()); + return std::string("???"); }); ContentRegistry::CommandPaletteCommands::add( diff --git a/source/views/view_command_palette.cpp b/source/views/view_command_palette.cpp index 380c4e785..a6173462f 100644 --- a/source/views/view_command_palette.cpp +++ b/source/views/view_command_palette.cpp @@ -45,6 +45,11 @@ namespace hex { } if (this->m_focusInputTextBox) { + auto textState = ImGui::GetInputTextState(ImGui::GetID("##command_input")); + if (textState != nullptr) { + textState->Stb.cursor = strlen(this->m_commandBuffer.data()); + } + ImGui::SetKeyboardFocusHere(0); this->m_focusInputTextBox = false; }