From 9bade7130bc0aa8cbcea82c446fc5747453b1360 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 28 Sep 2026 15:38:50 -0300 Subject: & aligns the selections into columns helix-golf's enumerate_and_align ends on %s |\d+&. align_selections treats the k-th range of each line as column k and puts spaces before each range until its head reaches the widest head of its column, measured in display cells, which File.rawDisplayCol already gives. A range over several lines refuses, as in helix. The example itself still needs more than 64 ranges, which the selection model does not hold. Co-Authored-By: Claude Opus 5.5 --- src/modal.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modal.zig') diff --git a/src/modal.zig b/src/modal.zig index 6bf7918f..aadaab00 100644 --- a/src/modal.zig +++ b/src/modal.zig @@ -111,6 +111,7 @@ pub const Normal = struct { join_select_space, rotate_contents_fwd, rotate_contents_back, + align_selections, indent, unindent, format, @@ -266,6 +267,7 @@ pub const Normal = struct { join_select_space, rotate_contents_forward, rotate_contents_backward, + align_selections, indent, unindent, comment_toggle, @@ -327,6 +329,7 @@ pub const Normal = struct { .join_select_space, .rotate_contents_forward, .rotate_contents_backward, + .align_selections, .comment_toggle, .undo, .redo, @@ -565,6 +568,7 @@ pub const Normal = struct { if (key.has(.join_select_space)) return resultAction(.{ .edit = .{ .kind = .join_select_space, .count = count } }); if (key.has(.rotate_contents_fwd)) return resultAction(.{ .edit = .{ .kind = .rotate_contents_forward, .count = count } }); if (key.has(.rotate_contents_back)) return resultAction(.{ .edit = .{ .kind = .rotate_contents_backward, .count = count } }); + if (key.has(.align_selections)) return resultAction(.{ .edit = .{ .kind = .align_selections, .count = count } }); if (key.has(.indent)) return resultAction(.{ .edit = .{ .kind = .indent, .count = count } }); if (key.has(.unindent)) return resultAction(.{ .edit = .{ .kind = .unindent, .count = count } }); if (key.has(.format)) return resultAction(.{ .lsp = .format }); -- cgit v1.3