summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-24 11:57:26 -0300
committerGabriel Schneider <[email protected]>2026-10-24 11:57:35 -0300
commit51903dd947f90381d1a908c488a019289a1c8413 (patch)
treeab5b2574642493c60476e6e9bcd7cc0e1c5e8d9e /src/exec.zig
parent18d89dcedaed1f8437799621675e88ca47d7cdc1 (diff)
downloadpardes-51903dd947f90381d1a908c488a019289a1c8413.tar.gz
pardes-51903dd947f90381d1a908c488a019289a1c8413.zip
Search converge 3/6: the query pane, line 1 the query and its first word the source, rows made live like Callstack's, the owner's places showing the set, a +Preview promoted in place, Enter freezes, Esc restores
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/exec.zig b/src/exec.zig
index a9c11049..2bc1a3e5 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -194,6 +194,20 @@ pub fn operandAt(p: *Pardes, pane: *Pane, clicked: Pane.Sel, borrow: bool, for_l
// the look is of the address it names (look.diffAddress), a regular
// look from there. A hunk line's code is words, looked at as ever:
// the code's, the prefix never one of them.
+ // A query pane's row pointed at on its gutter (its line number): the
+ // look is of the row's address (Query.rowAddress), as a +Diff line's
+ // prefix is its place; the row's code is words, looked at as ever.
+ if (for_look and pane.query != null and clicked.r0 >= pane.tag_rows and clicked.r0 == clicked.r1 and clicked.c0 == clicked.c1 and row >= 0 and col >= 0) gutter: {
+ var address_buf: [4096 + 32]u8 = undefined;
+ const address = panes.Query.rowAddress(pane, @intCast(row), @intCast(col), &address_buf) orelse break :gutter;
+ const meta = pane.file.?.location_rows[@intCast(row)];
+ result.text = p.scratch.allocator().dupe(u8, address) catch break :gutter;
+ result.file_word = .{ .row = row, .lo = 0, .hi = @intCast(meta.location_end) };
+ const expanded = fileWordCells(pane, clicked, row, 0, @intCast(meta.location_end)) orelse return result;
+ result.preview = expanded;
+ result.expanded = expanded;
+ return result;
+ }
var word_from: usize = 0;
if (for_look and clicked.r0 >= pane.tag_rows and clicked.r0 == clicked.r1 and clicked.c0 == clicked.c1 and row >= 0) diff: {
var address_buf: [4096 + 32]u8 = undefined;
@@ -1118,6 +1132,12 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
} else if (!p.settings.apply(setting, arg)) {
p.reportFailure(p.active, "CallstackDepth: takes " ++ comptime config.Runtime.takes(.callstack_depth).?);
},
+ .search_rows => if (arg == null) {
+ var said: [40]u8 = undefined;
+ return p.setMessage(p.active, std.fmt.bufPrint(&said, "SearchRows {d}", .{p.settings.search_rows}) catch "SearchRows");
+ } else if (!p.settings.apply(setting, arg)) {
+ p.reportFailure(p.active, "SearchRows: takes " ++ comptime config.Runtime.takes(.search_rows).?);
+ },
// Bare, it says the width, as acme's Tab does.
.tab => if (arg == null) {
var said: [32]u8 = undefined;