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.

Pull duplicate call out of `if`-`else` block

Joseph T. Lyonsdd89b2e6d497
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 701a6882a06..4e449bb7f77 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1545,11 +1545,10 @@ impl CodeActionsMenu {
fn select_next(&mut self, cx: &mut ViewContext<Editor>) {
if self.selected_item + 1 < self.actions.len() {
self.selected_item += 1;
- self.list.scroll_to(ScrollTarget::Show(self.selected_item));
} else {
self.selected_item = 0;
- self.list.scroll_to(ScrollTarget::Show(self.selected_item));
}
+ self.list.scroll_to(ScrollTarget::Show(self.selected_item));
cx.notify();
}