Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/mod.rs')
-rw-r--r--helix-term/src/ui/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 10f4104a..6a3e198c 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -83,7 +83,7 @@ pub fn raw_regex_prompt(
let (view, doc) = current!(cx.editor);
let doc_id = view.doc;
let snapshot = doc.selection(view.id).clone();
- let offset_snapshot = view.offset;
+ let offset_snapshot = doc.view_offset(view.id);
let config = cx.editor.config();
let mut prompt = Prompt::new(
@@ -95,7 +95,7 @@ pub fn raw_regex_prompt(
PromptEvent::Abort => {
let (view, doc) = current!(cx.editor);
doc.set_selection(view.id, snapshot.clone());
- view.offset = offset_snapshot;
+ doc.set_view_offset(view.id, offset_snapshot);
}
PromptEvent::Update | PromptEvent::Validate => {
// skip empty input
@@ -136,7 +136,7 @@ pub fn raw_regex_prompt(
Err(err) => {
let (view, doc) = current!(cx.editor);
doc.set_selection(view.id, snapshot.clone());
- view.offset = offset_snapshot;
+ doc.set_view_offset(view.id, offset_snapshot);
if event == PromptEvent::Validate {
let callback = async move {