summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-12-17 09:08:16 +0000
committerBlaž Hrastnik2020-12-17 09:08:16 +0000
commit7c75ec04e8db825f24f311d0c26109310738183d (patch)
treeacfcecf626aab578fc59dbbd406e0c38a8912348 /helix-term/src/commands.rs
parented60866c5485c8f7e8d2e12fd34dd8243d079b2a (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.rs8
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> {