diff options
author | Blaž Hrastnik | 2020-12-17 09:08:16 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-17 09:08:16 +0000 |
commit | 7c75ec04e8db825f24f311d0c26109310738183d (patch) | |
tree | acfcecf626aab578fc59dbbd406e0c38a8912348 /helix-term/src/commands.rs | |
parent | ed60866c5485c8f7e8d2e12fd34dd8243d079b2a (diff) |
File picker mockup, reuses the line editor work done on Prompt.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index cdd2ad34..4b246721 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -10,7 +10,7 @@ use helix_core::{ use once_cell::sync::Lazy; use crate::compositor::Compositor; -use crate::ui::{Prompt, PromptEvent}; +use crate::ui::{self, Prompt, PromptEvent}; use helix_view::{ document::Mode, @@ -456,6 +456,12 @@ pub fn command_mode(cx: &mut Context) { compositor.push(Box::new(prompt)); })); } +pub fn file_picker(cx: &mut Context) { + cx.callback = Some(Box::new(|compositor: &mut Compositor| { + let picker = ui::Picker::new(); + compositor.push(Box::new(picker)); + })); +} // calculate line numbers for each selection range fn selection_lines(state: &State) -> Vec<usize> { |