mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
Fixed command palette and added /web command
This commit is contained in:
@@ -18,7 +18,8 @@ namespace hex::plugin::builtin {
|
||||
|
||||
try {
|
||||
result = evaluator.evaluate(input);
|
||||
} catch (std::runtime_error &e) {}
|
||||
} catch (std::exception &e) {}
|
||||
|
||||
|
||||
if (result.has_value())
|
||||
return hex::format("#%s = %Lf", input.data(), result.value());
|
||||
@@ -26,6 +27,16 @@ namespace hex::plugin::builtin {
|
||||
return hex::format("#%s = ???", input.data());
|
||||
});
|
||||
|
||||
hex::ContentRegistry::CommandPaletteCommands::add(
|
||||
hex::ContentRegistry::CommandPaletteCommands::Type::KeywordCommand,
|
||||
"/web", "Website lookup",
|
||||
[](auto input) {
|
||||
return hex::format("Navigate to '%s'", input.data());
|
||||
},
|
||||
[](auto input) {
|
||||
hex::openWebpage(input);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user