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.

Fix runnable, code_actions button can not trigger when editor not focused (#11729)

Jason Lee6df1bc85aa44
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 1b28a229eed..a08e26520c4 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -4509,6 +4509,7 @@ impl Editor {
.icon_color(Color::Muted)
.selected(is_active)
.on_click(cx.listener(move |editor, _e, cx| {
+ editor.focus(cx);
editor.toggle_code_actions(
&ToggleCodeActions {
deployed_from_indicator: Some(row),
@@ -4540,12 +4541,13 @@ impl Editor {
row: DisplayRow,
cx: &mut ViewContext<Self>,
) -> IconButton {
- IconButton::new("code_actions_indicator", ui::IconName::Play)
+ IconButton::new("run_indicator", ui::IconName::Play)
.icon_size(IconSize::XSmall)
.size(ui::ButtonSize::None)
.icon_color(Color::Muted)
.selected(is_active)
.on_click(cx.listener(move |editor, _e, cx| {
+ editor.focus(cx);
editor.toggle_code_actions(
&ToggleCodeActions {
deployed_from_indicator: Some(row),