aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/editor.rs4
-rw-r--r--helix-term/src/ui/mod.rs7
2 files changed, 6 insertions, 5 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 4b4b9fb2..5913df29 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -570,7 +570,7 @@ impl EditorView {
// debug_assert!(cxt.count != 0);
// set the register
- cxt.register = cxt.editor.register.take();
+ cxt.selected_register = cxt.editor.selected_register.take();
if let Some(command) = self.keymap[&mode].get(&event) {
command(cxt);
@@ -610,7 +610,7 @@ impl Component for EditorView {
let mode = doc.mode();
let mut cxt = commands::Context {
- register: helix_view::RegisterSelection::default(),
+ selected_register: helix_view::RegisterSelection::default(),
editor: &mut cx.editor,
count: None,
callback: None,
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 7e4464bc..77e53690 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -20,6 +20,7 @@ pub use tui::layout::Rect;
pub use tui::style::{Color, Modifier, Style};
use helix_core::regex::Regex;
+use helix_core::register::Registers;
use helix_view::{Document, Editor, View};
use std::path::{Path, PathBuf};
@@ -27,7 +28,7 @@ use std::path::{Path, PathBuf};
pub fn regex_prompt(
cx: &mut crate::commands::Context,
prompt: String,
- fun: impl Fn(&mut View, &mut Document, Regex) + 'static,
+ fun: impl Fn(&mut View, &mut Document, &mut Registers, Regex) + 'static,
) -> Prompt {
let view_id = cx.view().id;
let snapshot = cx.doc().selection(view_id).clone();
@@ -53,13 +54,13 @@ pub fn regex_prompt(
match Regex::new(input) {
Ok(regex) => {
- let (view, doc) = editor.current();
+ let (view, doc, registers) = editor.current_with_registers();
// revert state to what it was before the last update
// TODO: also revert text
doc.set_selection(view.id, snapshot.clone());
- fun(view, doc, regex);
+ fun(view, doc, registers, regex);
view.ensure_cursor_in_view(doc);
}