diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 00:35:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:17:28 -0300 |
| commit | d5158f6a69ce5a1af6372c140b07379ee0ba2446 (patch) | |
| tree | ec722719840f59263e4b7dbc740681594b526274 /test | |
| parent | 3b31e0484bd06658f10cd9165b76cb1ca3b198bd (diff) | |
| download | pardes-d5158f6a69ce5a1af6372c140b07379ee0ba2446.tar.gz pardes-d5158f6a69ce5a1af6372c140b07379ee0ba2446.zip | |
Text, edit, normal, look, Query and their readers: the second selection form msel (whole rows r0..r1, for search-result highlights) goes; a visited search result and a query preview's place line are an explicit vsel like any other, back from the line's end (to the result's location start, the line's start for ordinary path:line rows; to the start for a preview line), and every msel branch in the edit ops, the drawing, the terminal's position tracking and the chords goes (visible: the result's highlight covers its line's characters and newline cell instead of the whole row width, with the ordinary selection colours; y, d and c on it act on that range as after x, its newline included, so a yanked result pastes as a line); selections.md and the ; Alt-; X Alt-x rows of helix-keys.md no longer describe msel; Text's walked shape changes (wire semantics)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test')
| -rw-r--r-- | test/hxdiff.zig | 3 | ||||
| -rw-r--r-- | test/panes.zig | 6 | ||||
| -rw-r--r-- | test/pdf.zig | 4 | ||||
| -rw-r--r-- | test/pdf_sections_bench.zig | 2 |
4 files changed, 4 insertions, 11 deletions
diff --git a/test/hxdiff.zig b/test/hxdiff.zig index b12bcd8e..257cce42 100644 --- a/test/hxdiff.zig +++ b/test/hxdiff.zig @@ -521,9 +521,6 @@ fn runCase(arena: std.mem.Allocator, case: Case, pane_kind: []const u8) !Result var anchor: Pos = .{ .row = pane.body.cur_row, .col = pane.body.cur_col }; if (pane.body.vsel.active) { anchor = .{ .row = pane.body.vsel.row, .col = pane.body.vsel.col }; - } else if (pane.body.msel.active) { - // line selection: the far end (the r0/r1 not holding the cursor), col 0 - anchor = .{ .row = if (pane.body.cur_row == pane.body.msel.r1) pane.body.msel.r0 else pane.body.msel.r1, .col = 0 }; } // mode "select" ONLY while v-extend is on (helix keeps x/%/mi selections // in normal mode); pane.body.mode itself never holds a select state diff --git a/test/panes.zig b/test/panes.zig index 160292a8..5a22e180 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -2210,7 +2210,7 @@ const OutputTests = struct { try fillResults(p, 0, "/", .{ .query = .hover }, "", try p.gpa.dupe(u8, "short\n"), null); try std.testing.expectEqualStrings("short\n", result.file.?.content); - try std.testing.expect(!result.body.vsel.active and !result.body.msel.active and !result.body.select); + try std.testing.expect(!result.body.vsel.active and !result.body.select); try std.testing.expectEqual(@as(u16, 0), result.body.nsel); try std.testing.expectEqual(@as(i32, 0), result.body.cur_row); try std.testing.expectEqual(@as(i32, 0), result.body.cur_col); @@ -2246,7 +2246,7 @@ const OutputTests = struct { try std.testing.expect(p.drag == .none); p.update(.{ .mouse = .{ .button = config.select_button, .kind = .release, .col = x + 2, .row = y + 1 } }); for (result.sel) |selection| try std.testing.expectEqual(.none, selection.state); - try std.testing.expect(!result.body.vsel.active and !result.body.msel.active); + try std.testing.expect(!result.body.vsel.active); } test "result refill identity retains the full bounded argument" { @@ -3816,7 +3816,6 @@ const LookResetTests = struct { pane.body.cur_row = 0; pane.body.cur_col = 3; pane.body.vsel = .{ .active = true, .explicit = true, .row = 0, .col = 0 }; - pane.body.msel = .{ .active = true, .r0 = 0, .r1 = 1 }; _ = pane.body.reserveSels(); pane.body.sels[0] = .{ .row = 1, .col = 2, .arow = 0, .acol = 1 }; pane.body.nsel = 1; @@ -3838,7 +3837,6 @@ const LookResetTests = struct { } fn cleared(pane: *const Pane) !void { - try std.testing.expect(!pane.body.msel.active); try std.testing.expectEqual(@as(u16, 0), pane.body.nsel); try std.testing.expect(!pane.body.select); try std.testing.expectEqual(modal.Normal.State{}, pane.body.normal); diff --git a/test/pdf.zig b/test/pdf.zig index e4993bfb..053e45dc 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -1768,7 +1768,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" { const scroll_before = pv.document_scroll_y; const sels_before = pane.sel; const cursor_before = .{ pane.body.cur_row, pane.body.cur_col }; - const modal_before = .{ pane.body.msel, pane.body.vsel, pane.body.nsel }; + const modal_before = .{ pane.body.vsel, pane.body.nsel }; const selection_before = pv.selection orelse return error.MissingPdfSelection; const selection_quads_before = try gpa.dupe(pdf_impl.Quad, selection_before.quads); defer gpa.free(selection_quads_before); @@ -1823,7 +1823,7 @@ test "PDF native mouse selection, Look, and highlights share page geometry" { try std.testing.expectEqual(scroll_before, pv.document_scroll_y); try std.testing.expect(std.meta.eql(sels_before, pane.sel)); try std.testing.expectEqual(cursor_before, .{ pane.body.cur_row, pane.body.cur_col }); - try std.testing.expect(std.meta.eql(modal_before, .{ pane.body.msel, pane.body.vsel, pane.body.nsel })); + try std.testing.expect(std.meta.eql(modal_before, .{ pane.body.vsel, pane.body.nsel })); const selection_after = pv.selection orelse return error.HoverDroppedPdfSelection; try std.testing.expectEqualSlices(pdf_impl.Quad, selection_quads_before, selection_after.quads); try std.testing.expectEqualStrings(selection_text_before, pv.selection_text); diff --git a/test/pdf_sections_bench.zig b/test/pdf_sections_bench.zig index 4d0f85de..4ab4b5c4 100644 --- a/test/pdf_sections_bench.zig +++ b/test/pdf_sections_bench.zig @@ -298,7 +298,6 @@ fn perturbReopen(prepared: PreparedReopen, operation: usize) void { output_file.scroll = @intCast(operation % 17 + 1); prepared.output.body.cur_row = marker; prepared.output.body.cur_col = marker + 1; - prepared.output.body.msel.active = true; prepared.output.body.vsel.active = true; prepared.output.body.nsel = 1; prepared.owner.search_pane = null; @@ -311,7 +310,6 @@ fn observeReopen(prepared: PreparedReopen) u64 { var observed: u64 = file.scroll; observed = observed *% 131 +% @as(u64, @intCast(@max(0, prepared.output.body.cur_row))); observed = observed *% 131 +% @as(u64, @intCast(@max(0, prepared.output.body.cur_col))); - observed = observed *% 131 +% @intFromBool(prepared.output.body.msel.active); observed = observed *% 131 +% @intFromBool(prepared.output.body.vsel.active); observed = observed *% 131 +% prepared.output.body.nsel; observed = observed *% 131 +% (prepared.owner.search_pane orelse std.math.maxInt(usize)); |
