mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
ensure cursor in view after goto mark
This commit is contained in:
parent
b82036bb3f
commit
adb7658517
@ -581,6 +581,7 @@ fn goto_mark(
|
||||
)
|
||||
.unwrap_or('^');
|
||||
|
||||
let scrolloff = cx.editor.config().scrolloff;
|
||||
// use some helper functions to avoid making the borrow checker angry
|
||||
let registers_vals = read_from_register(cx.editor, register_name);
|
||||
let (doc_id, history_rev, mut selection) = parse_mark_register_contents(registers_vals)?;
|
||||
@ -598,6 +599,9 @@ fn goto_mark(
|
||||
};
|
||||
|
||||
doc.set_selection(view.id, selection);
|
||||
|
||||
view.ensure_cursor_in_view(doc, scrolloff);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user