diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1e89fe1cb..0c24c6933 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2705,6 +2705,9 @@ impl ui::menu::Item for MappableCommand { } pub fn command_palette(cx: &mut Context) { + let register = cx.register; + let count = cx.count; + cx.callback = Some(Box::new( move |compositor: &mut Compositor, cx: &mut compositor::Context| { let keymap = compositor.find::().unwrap().keymaps.map() @@ -2722,8 +2725,8 @@ pub fn command_palette(cx: &mut Context) { let picker = Picker::new(commands, keymap, move |cx, command, _action| { let mut ctx = Context { - register: None, - count: std::num::NonZeroUsize::new(1), + register, + count, editor: cx.editor, callback: None, on_next_key_callback: None,