aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorIvan Tham2021-11-10 01:46:55 +0000
committerGitHub2021-11-10 01:46:55 +0000
commit97893cca641545dc42e6b3ceabc8ed433f66a4d6 (patch)
tree66cd39c41076ff9b0dc48b87ab5ad1924658e593 /helix-term/src
parent7c9f6202361e38951820d69227eade5f1677be3c (diff)
Restore screen position when abort search (#1047)
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/ui/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 24eb7acd..62da0dce 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -35,6 +35,7 @@ pub fn regex_prompt(
let (view, doc) = current!(cx.editor);
let view_id = view.id;
let snapshot = doc.selection(view_id).clone();
+ let offset_snapshot = view.offset;
Prompt::new(
prompt,
@@ -45,6 +46,7 @@ pub fn regex_prompt(
PromptEvent::Abort => {
let (view, doc) = current!(cx.editor);
doc.set_selection(view.id, snapshot.clone());
+ view.offset = offset_snapshot;
}
PromptEvent::Validate => {
// TODO: push_jump to store selection just before jump