aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorNathan Vegdahl2021-07-24 00:23:16 +0000
committerNathan Vegdahl2021-07-24 00:23:16 +0000
commit43594049ddd6b0ec3794807016ab3cd2a6a38834 (patch)
tree56e0bd5b7ac016937612aa650de2f06041a2e258 /helix-term/src/commands.rs
parent427ae6ac6cfdd2a89580692dadd45f1a8dc02d2c (diff)
parentbda4f5c1cdd2f84a06647f7dce45a8f6d06401ae (diff)
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 8bde88a2..57df47a7 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -214,6 +214,7 @@ impl Command {
file_picker,
buffer_picker,
symbol_picker,
+ last_picker,
prepend_to_line,
append_to_line,
open_below,
@@ -2127,6 +2128,17 @@ fn symbol_picker(cx: &mut Context) {
)
}
+fn last_picker(cx: &mut Context) {
+ // TODO: last picker does not seemed to work well with buffer_picker
+ cx.callback = Some(Box::new(|compositor: &mut Compositor| {
+ if let Some(picker) = compositor.last_picker.take() {
+ compositor.push(picker);
+ }
+ // XXX: figure out how to show error when no last picker lifetime
+ // cx.editor.set_error("no last picker".to_owned())
+ }));
+}
+
// I inserts at the first nonwhitespace character of each line with a selection
fn prepend_to_line(cx: &mut Context) {
goto_first_nonwhitespace(cx);
@@ -3837,6 +3849,8 @@ macro_rules! mode_info {
mode_info! {
/// space mode
space_mode, SPACE_MODE,
+ /// resume last picker
+ "'" => last_picker,
/// file picker
"f" => file_picker,
/// buffer picker