mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
Don't focus results editor on cmd-shift-f
when there are no results
This commit is contained in:
parent
afea5a3d5e
commit
a78fe4ef6a
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,6 @@ action!(ToggleFocus);
|
|||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
cx.add_bindings([
|
||||
Binding::new("cmd-shift-F", ToggleFocus, Some("ProjectFindView")),
|
||||
Binding::new("cmd-shift-F", ToggleFocus, Some("ProjectFindView")),
|
||||
Binding::new("cmd-f", ToggleFocus, Some("ProjectFindView")),
|
||||
Binding::new("cmd-shift-F", Deploy(true), Some("Workspace")),
|
||||
|
@ -385,7 +384,9 @@ impl ProjectFindView {
|
|||
|
||||
fn toggle_focus(&mut self, _: &ToggleFocus, cx: &mut ViewContext<Self>) {
|
||||
if self.query_editor.is_focused(cx) {
|
||||
cx.focus(&self.results_editor);
|
||||
if !self.model.read(cx).highlighted_ranges.is_empty() {
|
||||
cx.focus(&self.results_editor);
|
||||
}
|
||||
} else {
|
||||
cx.focus(&self.query_editor);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue