feat: don't center screen when navigation destination is on-screen

This commit is contained in:
CJ van den Berg 2024-04-09 21:45:54 +02:00
parent 31561242db
commit 3e97f6627c

View file

@ -3162,7 +3162,10 @@ pub const Editor = struct {
@intCast(if (column < 1) 0 else column - 1),
) catch |e| return tp.exit_error(e);
if (have_sel) primary.selection = sel;
try self.scroll_view_center(.{});
if (self.view.is_visible(&primary.cursor))
self.clamp()
else
try self.scroll_view_center(.{});
try self.send_editor_jump_destination();
}