Skip to content

Commit

Permalink
ensure cursor in view after goto mark
Browse files Browse the repository at this point in the history
  • Loading branch information
savente93 committed Sep 16, 2024
1 parent b82036b commit adb7658
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand All @@ -598,6 +599,9 @@ fn goto_mark(
};

doc.set_selection(view.id, selection);

view.ensure_cursor_in_view(doc, scrolloff);

Ok(())
}

Expand Down

0 comments on commit adb7658

Please sign in to comment.