aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorLudwig Stecher2022-02-15 01:24:03 +0000
committerGitHub2022-02-15 01:24:03 +0000
commit442999384256f89eddfa6625a0ffb0257df65ef7 (patch)
tree508ed85a7e294b665f543da7fd23d93dc56e1d30 /helix-term/src/commands.rs
parent23907a063c43f06f120d80a6ec0b6748881236a1 (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/commands.rs')
-rw-r--r--helix-term/src/commands.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 5e3e1c43..1454a93f 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -44,7 +44,7 @@ use movement::Movement;
use crate::{
args,
compositor::{self, Component, Compositor},
- ui::{self, FilePicker, Popup, Prompt, PromptEvent},
+ ui::{self, overlay::overlayed, FilePicker, Popup, Prompt, PromptEvent},
};
use crate::job::{self, Job, Jobs};
@@ -1824,7 +1824,7 @@ fn global_search(cx: &mut Context) {
},
|_editor, (line_num, path)| Some((path.clone(), Some((*line_num, *line_num)))),
);
- compositor.push(Box::new(picker));
+ compositor.push(Box::new(overlayed(picker)));
});
Ok(call)
};
@@ -3359,7 +3359,7 @@ fn file_picker(cx: &mut Context) {
// We don't specify language markers, root will be the root of the current git repo
let root = find_root(None, &[]).unwrap_or_else(|| PathBuf::from("./"));
let picker = ui::file_picker(root, &cx.editor.config);
- cx.push_layer(Box::new(picker));
+ cx.push_layer(Box::new(overlayed(picker)));
}
fn buffer_picker(cx: &mut Context) {
@@ -3427,7 +3427,7 @@ fn buffer_picker(cx: &mut Context) {
Some((meta.path.clone()?, Some((line, line))))
},
);
- cx.push_layer(Box::new(picker));
+ cx.push_layer(Box::new(overlayed(picker)));
}
fn symbol_picker(cx: &mut Context) {
@@ -3505,7 +3505,7 @@ fn symbol_picker(cx: &mut Context) {
},
);
picker.truncate_start = false;
- compositor.push(Box::new(picker))
+ compositor.push(Box::new(overlayed(picker)))
}
},
)
@@ -3564,7 +3564,7 @@ fn workspace_symbol_picker(cx: &mut Context) {
},
);
picker.truncate_start = false;
- compositor.push(Box::new(picker))
+ compositor.push(Box::new(overlayed(picker)))
}
},
)
@@ -4225,7 +4225,7 @@ fn goto_impl(
Some((path, line))
},
);
- compositor.push(Box::new(picker));
+ compositor.push(Box::new(overlayed(picker)));
}
}
}