diff options
author | Ludwig Stecher | 2022-02-15 01:24:03 +0000 |
---|---|---|
committer | GitHub | 2022-02-15 01:24:03 +0000 |
commit | 442999384256f89eddfa6625a0ffb0257df65ef7 (patch) | |
tree | 508ed85a7e294b665f543da7fd23d93dc56e1d30 /helix-term/src/application.rs | |
parent | 23907a063c43f06f120d80a6ec0b6748881236a1 (diff) |
Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker (#1612)
* Add `PageUp`, `PageDown`, `Ctrl-u`, `Ctrl-d`, `Home`, `End` keyboard shortcuts to file picker
* Refactor file picker paging logic
* change key mapping
* Add overlay component
* Use closure instead of margin to calculate size
* Don't wrap file picker in `Overlay` automatically
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r-- | helix-term/src/application.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 6ba05498..118792ca 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -13,7 +13,7 @@ use crate::{ compositor::Compositor, config::Config, job::Jobs, - ui, + ui::{self, overlay::overlayed}, }; use log::{error, warn}; @@ -124,7 +124,8 @@ impl Application { if first.is_dir() { std::env::set_current_dir(&first)?; editor.new_file(Action::VerticalSplit); - compositor.push(Box::new(ui::file_picker(".".into(), &config.editor))); + let picker = ui::file_picker(".".into(), &config.editor); + compositor.push(Box::new(overlayed(picker))); } else { let nr_of_files = args.files.len(); editor.open(first.to_path_buf(), Action::VerticalSplit)?; |