Implement shortcut execution logic and update Cut command handling in EditorManager

This commit is contained in:
scawful
2025-03-09 18:42:04 -04:00
parent 02ae11ec9e
commit 7b2c919745
3 changed files with 38 additions and 3 deletions

View File

@@ -127,8 +127,9 @@ void EditorManager::Initialize(const std::string &filename) {
{},
{},
{
{absl::StrCat(ICON_MD_CONTENT_CUT, " Cut"), "Cmd+X",
[&]() { status_ = current_editor_->Cut(); }},
{absl::StrCat(ICON_MD_CONTENT_CUT, " Cut"),
context_.shortcut_manager.GetKeys("Cut"),
context_.shortcut_manager.GetCallback("Cut")},
{absl::StrCat(ICON_MD_CONTENT_COPY, " Copy"), "Cmd+C",
[&]() { status_ = current_editor_->Copy(); }},
{absl::StrCat(ICON_MD_CONTENT_PASTE, " Paste"), "Cmd+V",
@@ -181,7 +182,8 @@ void EditorManager::Initialize(const std::string &filename) {
}
absl::Status EditorManager::Update() {
ManageKeyboardShortcuts();
// ManageKeyboardShortcuts();
ExecuteShortcuts(context_.shortcut_manager);
DrawMenuBar();
DrawPopups();