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.

Unbork test relying on old keystroke behavior

Juliabf8f3e3d6856
diff --git a/crates/gpui/src/interactive.rs b/crates/gpui/src/interactive.rs
index 6fc7cfc8e8d..0be917350df 100644
--- a/crates/gpui/src/interactive.rs
+++ b/crates/gpui/src/interactive.rs
@@ -307,7 +307,10 @@ mod test {
div().id("testview").child(
div()
.key_context("parent")
- .on_key_down(cx.listener(|this, _, _| this.saw_key_down = true))
+ .on_key_down(cx.listener(|this, _, cx| {
+ cx.stop_propagation();
+ this.saw_key_down = true
+ }))
.on_action(
cx.listener(|this: &mut TestView, _: &TestAction, _| {
this.saw_action = true
@@ -343,6 +346,7 @@ mod test {
.update(cx, |test_view, cx| cx.focus(&test_view.focus_handle))
.unwrap();
+ cx.dispatch_keystroke(*window, Keystroke::parse("a").unwrap(), false);
cx.dispatch_keystroke(*window, Keystroke::parse("ctrl-g").unwrap(), false);
window