Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

rules_library: Register ActionSequence handler (#51890)

João Soares9c06648e5992
diff --git a/crates/rules_library/src/rules_library.rs b/crates/rules_library/src/rules_library.rs
index 387417d8bfb..b4ff8033446 100644
--- a/crates/rules_library/src/rules_library.rs
+++ b/crates/rules_library/src/rules_library.rs
@@ -15,7 +15,7 @@ use picker::{Picker, PickerDelegate};
use platform_title_bar::PlatformTitleBar;
use release_channel::ReleaseChannel;
use rope::Rope;
-use settings::Settings;
+use settings::{ActionSequence, Settings};
use std::rc::Rc;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
@@ -1399,6 +1399,13 @@ impl Render for RulesLibrary {
v_flex()
.id("rules-library")
.key_context("RulesLibrary")
+ .on_action(
+ |action_sequence: &ActionSequence, window: &mut Window, cx: &mut App| {
+ for action in &action_sequence.0 {
+ window.dispatch_action(action.boxed_clone(), cx);
+ }
+ },
+ )
.on_action(cx.listener(|this, &NewRule, window, cx| this.new_rule(window, cx)))
.on_action(
cx.listener(|this, &DeleteRule, window, cx| {