diff options
author | Blaž Hrastnik | 2021-07-24 08:48:45 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-07-26 02:19:33 +0000 |
commit | 63e54e30a74bb0d1d782877ddbbcf95f2817d061 (patch) | |
tree | 39be3b1e809d4c85c6a7bd132c240e854de985bf /helix-term/src/commands.rs | |
parent | 29cefa1be860e38a11347f0798159e0f4ddfe173 (diff) |
Implement in-memory prompt history
Implementation is similar to kakoune: we store the entries into
a register.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 06dca5d5..c51453b0 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1126,7 +1126,7 @@ fn delete_selection(cx: &mut Context) { let reg_name = cx.selected_register.name(); let (view, doc) = current!(cx.editor); let registers = &mut cx.editor.registers; - let reg = registers.get_or_insert(reg_name); + let reg = registers.get_mut(reg_name); delete_selection_impl(reg, doc, view.id); doc.append_changes_to_history(view.id); @@ -1139,7 +1139,7 @@ fn change_selection(cx: &mut Context) { let reg_name = cx.selected_register.name(); let (view, doc) = current!(cx.editor); let registers = &mut cx.editor.registers; - let reg = registers.get_or_insert(reg_name); + let reg = registers.get_mut(reg_name); delete_selection_impl(reg, doc, view.id); enter_insert_mode(doc); } @@ -1920,6 +1920,7 @@ mod cmd { fn command_mode(cx: &mut Context) { let mut prompt = Prompt::new( ":".to_owned(), + Some(':'), |input: &str| { // we use .this over split_whitespace() because we care about empty segments let parts = input.split(' ').collect::<Vec<&str>>(); |