summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 00:42:04 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit425d9beb9c977df364ed83743cb2efdef9429478 (patch)
treeeaba2e20ff041b50539d1b47fdeb498e59237cf0 /src/builtins.zig
parent1912878e753ce12fdc1ac72ae2e83ddfc18df002 (diff)
downloadpardes-425d9beb9c977df364ed83743cb2efdef9429478.tar.gz
pardes-425d9beb9c977df364ed83743cb2efdef9429478.zip
File the tag code into tagline.zig and draw tags beside bodies
With tags reduced to Texts, what is left of them is the computed prefix, the default and saved tails, entering and leaving a tag and the headers: that goes to tagline.zig, as acme keeps the tag half of a window in wind.c. Tag and header drawing moves next to body drawing in body_layer.zig, and the tag hit helpers go to tag_layer.zig with the Hit they read, where sameCell now also tells the lines of a taller tag apart. The docs describe the tag as a Text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 74645376..e9f29102 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1,6 +1,7 @@
//! Command structs and runtime settings form the builtin registry; bindings live in config.zig.
const std = @import("std");
const pardes = @import("pardes.zig");
+const tagline = @import("tagline.zig");
const dump = @import("dump.zig");
const exec = @import("exec.zig");
const look = @import("look.zig");
@@ -742,7 +743,7 @@ pub const Grep = struct {
pub const Left = struct {
pub fn run(c: Ctx) void {
if (c.p.header_focus) {
- if (c.p.header_column) |column| if (column > 0) c.p.enterHeader(column - 1);
+ if (c.p.header_column) |column| if (column > 0) tagline.enterHeader(c.p, column - 1);
return;
}
_ = layout.focusDir(c.p, c.id, .left);
@@ -754,10 +755,10 @@ pub const Down = struct {
if (c.p.header_focus) {
const column = layout.findPane(c.p, c.id);
if (c.p.header_column == null and c.p.columnBarHeight() > 0)
- return c.p.enterHeader(if (column) |at| at.col else 0);
+ return tagline.enterHeader(c.p, if (column) |at| at.col else 0);
// Onto the top pane of the column the header stands over.
const col = c.p.header_column orelse if (column) |at| at.col else return;
- c.p.exitHeader();
+ tagline.exitHeader(c.p);
if (col < c.p.ncol and c.p.col_n[col] > 0) c.p.active = c.p.col_panes[col][0];
return;
}
@@ -768,20 +769,20 @@ pub const Down = struct {
pub const Up = struct {
pub fn run(c: Ctx) void {
if (c.p.header_focus) {
- if (c.p.header_column != null and c.p.topBarHeight() > 0) c.p.enterHeader(null);
+ if (c.p.header_column != null and c.p.topBarHeight() > 0) tagline.enterHeader(c.p, null);
return;
}
if (layout.focusDir(c.p, c.id, .up)) return;
if (c.p.columnBarHeight() > 0) {
- if (layout.findPane(c.p, c.id)) |at| c.p.enterHeader(at.col);
- } else if (c.p.topBarHeight() > 0) c.p.enterHeader(null);
+ if (layout.findPane(c.p, c.id)) |at| tagline.enterHeader(c.p, at.col);
+ } else if (c.p.topBarHeight() > 0) tagline.enterHeader(c.p, null);
}
};
pub const Right = struct {
pub fn run(c: Ctx) void {
if (c.p.header_focus) {
- if (c.p.header_column) |column| if (column + 1 < c.p.ncol) c.p.enterHeader(column + 1);
+ if (c.p.header_column) |column| if (column + 1 < c.p.ncol) tagline.enterHeader(c.p, column + 1);
return;
}
_ = layout.focusDir(c.p, c.id, .right);