feat: Allow command palette to work with previous results

This commit is contained in:
WerWolv
2024-12-23 23:42:45 +01:00
parent 9274fac8e1
commit 2ae69e8e72
4 changed files with 39 additions and 10 deletions

View File

@@ -380,7 +380,7 @@ namespace hex {
};
using DisplayCallback = std::function<std::string(std::string)>;
using ExecuteCallback = std::function<void(std::string)>;
using ExecuteCallback = std::function<std::optional<std::string>(std::string)>;
using QueryCallback = std::function<std::vector<QueryResult>(std::string)>;
struct Entry {
@@ -416,7 +416,7 @@ namespace hex {
const std::string &command,
const UnlocalizedString &unlocalizedDescription,
const impl::DisplayCallback &displayCallback,
const impl::ExecuteCallback &executeCallback = [](auto) {});
const impl::ExecuteCallback &executeCallback = [](auto) { return std::nullopt; });
/**
* @brief Adds a new command handler to the command palette