
Co-Authored-By: Antonio Scandurra <me@as-cii.com> Co-Authored-By: Nathan Sobo <nathan@zed.dev>
19 lines
634 B
Rust
19 lines
634 B
Rust
use gpui::{action, keymap::Binding, MutableAppContext};
|
|
|
|
action!(Confirm);
|
|
action!(SelectPrev);
|
|
action!(SelectNext);
|
|
action!(SelectFirst);
|
|
action!(SelectLast);
|
|
|
|
pub fn init(cx: &mut MutableAppContext) {
|
|
cx.add_bindings([
|
|
Binding::new("up", SelectPrev, Some("menu")),
|
|
Binding::new("ctrl-p", SelectPrev, Some("menu")),
|
|
Binding::new("down", SelectNext, Some("menu")),
|
|
Binding::new("ctrl-n", SelectNext, Some("menu")),
|
|
Binding::new("cmd-up", SelectFirst, Some("menu")),
|
|
Binding::new("cmd-down", SelectLast, Some("menu")),
|
|
Binding::new("enter", Confirm, Some("menu")),
|
|
]);
|
|
}
|