mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
Restore screen position when abort search (#1047)
This commit is contained in:
parent
7c9f620236
commit
97893cca64
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user