Don't open file finder menu on command (#25097)

Closes #24740

Release Notes:

- Don't open the split menu in the file finder when command is pressed
This commit is contained in:
Conrad Irwin 2025-02-18 14:27:10 -07:00 committed by GitHub
parent bff1548b48
commit 48f87a8d9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 53 deletions

View file

@ -767,13 +767,7 @@
}
},
{
"context": "FileFinder",
"bindings": {
"ctrl": "file_finder::ToggleMenu"
}
},
{
"context": "FileFinder && !menu_open",
"context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)",
"bindings": {
"ctrl-shift-p": "file_finder::SelectPrev",
"ctrl-j": "pane::SplitDown",
@ -782,15 +776,6 @@
"ctrl-l": "pane::SplitRight"
}
},
{
"context": "FileFinder && menu_open",
"bindings": {
"j": "pane::SplitDown",
"k": "pane::SplitUp",
"h": "pane::SplitLeft",
"l": "pane::SplitRight"
}
},
{
"context": "TabSwitcher",
"bindings": {

View file

@ -785,14 +785,7 @@
}
},
{
"context": "FileFinder",
"use_key_equivalents": true,
"bindings": {
"cmd": "file_finder::ToggleMenu"
}
},
{
"context": "FileFinder && !menu_open",
"context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)",
"use_key_equivalents": true,
"bindings": {
"cmd-shift-p": "file_finder::SelectPrev",
@ -802,16 +795,6 @@
"cmd-l": "pane::SplitRight"
}
},
{
"context": "FileFinder && menu_open",
"use_key_equivalents": true,
"bindings": {
"j": "pane::SplitDown",
"k": "pane::SplitUp",
"h": "pane::SplitLeft",
"l": "pane::SplitRight"
}
},
{
"context": "TabSwitcher",
"use_key_equivalents": true,

View file

@ -34,7 +34,7 @@ use std::{
};
use text::Point;
use ui::{
prelude::*, ContextMenu, HighlightedLabel, KeyBinding, ListItem, ListItemSpacing, PopoverMenu,
prelude::*, ContextMenu, HighlightedLabel, ListItem, ListItemSpacing, PopoverMenu,
PopoverMenuHandle,
};
use util::{paths::PathWithPosition, post_inc, ResultExt};
@ -1448,11 +1448,7 @@ impl PickerDelegate for FileFinderDelegate {
)
}
fn render_footer(
&self,
window: &mut Window,
cx: &mut Context<Picker<Self>>,
) -> Option<AnyElement> {
fn render_footer(&self, _: &mut Window, cx: &mut Context<Picker<Self>>) -> Option<AnyElement> {
let context = self.focus_handle.clone();
Some(
h_flex()
@ -1463,9 +1459,7 @@ impl PickerDelegate for FileFinderDelegate {
.border_t_1()
.border_color(cx.theme().colors().border_variant)
.child(
Button::new("open-selection", "Open")
.key_binding(KeyBinding::for_action(&menu::Confirm, window, cx))
.on_click(|_, window, cx| {
Button::new("open-selection", "Open").on_click(|_, window, cx| {
window.dispatch_action(menu::Confirm.boxed_clone(), cx)
}),
)
@ -1475,14 +1469,8 @@ impl PickerDelegate for FileFinderDelegate {
.attach(gpui::Corner::TopRight)
.anchor(gpui::Corner::BottomRight)
.trigger(
Button::new("actions-trigger", "Split Options")
.selected_label_color(Color::Accent)
.key_binding(KeyBinding::for_action_in(
&ToggleMenu,
&context,
window,
cx,
)),
Button::new("actions-trigger", "Split…")
.selected_label_color(Color::Accent),
)
.menu({
move |window, cx| {