diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/normal.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/normal.zig b/src/normal.zig index 4d3cc96b..6d7eb69c 100644 --- a/src/normal.zig +++ b/src/normal.zig @@ -664,10 +664,12 @@ fn executeNormalAction(p: *Pardes, t: *Text, a: modal.Normal.Action) edit.Error! const at = t.last_edit orelse return; return t.pointMove(text, range, modal.offsetAt(text, .{ .row = @intCast(@max(0, at.row)), .col = @intCast(@max(0, at.col)) })); }, + // helix align_view: the cursor's row goes `above` rows down the + // view, the middle of an odd one and the upper middle of an even one .view_top, .view_center, .view_bottom => if (t.what == .body) { const above: i32 = switch (a.role) { .view_top => 0, - .view_center => @divTrunc(@as(i32, pane.rows), 2) - 1, + .view_center => @divTrunc(@as(i32, pane.rows) - 1, 2), else => @as(i32, pane.rows) - 1, }; pane.scrollBy(t.cur_row - (pane.scroll() + above)); |
