summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 00:08:16 -0300
committerGabriel Schneider <[email protected]>2026-11-05 00:32:56 -0300
commit2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1 (patch)
tree8dcc7111d1e78806c6ac0e0bd1493c25d86bfc85 /src
parent43a4c24e607a456d7a23eb8a779bce5651f18222 (diff)
downloadpardes-2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1.tar.gz
pardes-2367ed34beccf3f2f1b8bbf6b8a171f50933d7a1.zip
config, exec, look: Placement, BootShell, LookWord, DirLook and DiffLook go, with what each kept of pardes before it took acme's ways (exec's pardesPlace, atFoot, belowParent, pardesDoc and evictLonePristineTty with mouse.zig's call, layout's splitParent and columnFitsHalves that only they called, look's ls in a terminal for a directory, the word and patch looks' other branches, the SPC c p key, their Help and builtins-JSON rows, their lines in docs/typ and a changelog line), and the tests of them: Dir.zig's "DirLook terminal: a look at a directory opens a terminal there, no pane listing it", pardes.zig's "first document fallback splits like Term from the originating pane", "first document keeps its originating shell and only opens a column when it fits", "BootShell keep leaves the untouched boot shell a dragged document joins; replace closes it" and "a Look on a directory does not type ls into an occupied terminal", keys.zig's "keys: SPC j n and SPC j p walk on from the place a Look's +Search listing chose, its keyboard left in the file", look_and_exec.zig's "look-and-exec: a second LookWord list look in a directory refills its +Search rather than stacking another", placement.zig's "placement: Placement pardes puts a new pane right under the asking one, and bare it steps back to acme", output.zig's "LookNext/LookPrev keeps the result output a Look chose through a no-match answer, and a stale serial once it is deleted", and the snapshot scripts that turned them on (cmdword, doccol, look-dir, lookpanes, rsearch, splitparent, ttylook); the Del question's test makes its middle panes the acme way, a New at the column's foot, and the others that turned one on for their layout run without it
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src')
-rw-r--r--src/CHANGELOG.md7
-rw-r--r--src/Dir.zig25
-rw-r--r--src/Output.zig8
-rw-r--r--src/config.zig35
-rw-r--r--src/dump.zig2
-rw-r--r--src/exec.zig145
-rw-r--r--src/hunks.zig8
-rw-r--r--src/layout.zig21
-rw-r--r--src/look.zig28
-rw-r--r--src/mouse.zig6
-rw-r--r--src/ninep/cols.zig31
-rw-r--r--src/ninep/ctl.zig16
-rw-r--r--src/ninep/tree.zig1
-rw-r--r--src/pardes.zig164
14 files changed, 78 insertions, 419 deletions
diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md
index 0b10238f..25d167f4 100644
--- a/src/CHANGELOG.md
+++ b/src/CHANGELOG.md
@@ -2,6 +2,13 @@
## Unreleased
+- `Placement`, `BootShell`, `LookWord`, `DirLook` and `DiffLook` are gone,
+ with what each kept of pardes before it took acme's ways: its own
+ placement (`Placement pardes`, `SPC c p`), a dragged document closing
+ the boot shell, a word looked at listing every place in a `+Search` (a
+ terminal's word still does), a directory looked at typing `ls` into a
+ terminal, and a patch looked at opening as text (`Diff` on its `+Diff`
+ still shows it).
- The root ctl reads the settings in DumpConfig's words: one this
frontend lacks is a `# Word unsupported` comment, which a write of it
back skips, `Font` is the path or name asked for, `Shader off` says the
diff --git a/src/Dir.zig b/src/Dir.zig
index ebe6b69c..f43c6e02 100644
--- a/src/Dir.zig
+++ b/src/Dir.zig
@@ -179,8 +179,8 @@ pub fn refresh(p: *Pardes, id: usize) !void {
panes.Output.resetBody(p, now);
}
-/// A look at directory `dir` (look.zig's `.dir`, with `DirLook pane`): its
-/// pane, read again, or a new one, placed as a document is.
+/// A look at directory `dir` (look.zig's `.dir`): its pane, read again, or
+/// a new one, placed as a document is.
pub fn look(p: *Pardes, from: usize, dir: []const u8) void {
const name = (if (std.mem.endsWith(u8, dir, "/"))
p.gpa.dupe(u8, dir)
@@ -433,27 +433,6 @@ test "an exec in a directory pane runs in its directory, and its +Errors goes th
try testing.expect(named(p, try std.fmt.bufPrint(&errors_buf, "{s}{s}", .{ sub_name, config.errors_buffer })).id != null);
}
-test "DirLook terminal: a look at a directory opens a terminal there, no pane listing it" {
- if (comptime !pardes.hosted) return;
- var tmp = testing.tmpDir(.{});
- defer tmp.cleanup();
- var buf: [4096]u8 = undefined;
- const s = try session(&tmp, &buf);
- defer s.p.deinit();
- const p = s.p;
- try testing.expect(p.executeBuiltinLine(0, "DirLook terminal"));
- try testing.expectEqual(config.Runtime.DirLook.terminal, p.settings.dir_look);
- pardes.look.lookAt(p, 0, s.dir);
- p.sync();
- var name_buf: [4200]u8 = undefined;
- try testing.expectEqual(@as(usize, 0), named(p, try std.fmt.bufPrint(&name_buf, "{s}/", .{s.dir})).count);
- try testing.expect(p.panes[p.active].?.isTerminal());
- try testing.expectEqualStrings(s.dir, p.panes[p.active].?.cwdSlice());
- // Bare, it steps back to pane, the default.
- try testing.expect(p.executeBuiltinLine(0, "DirLook"));
- try testing.expectEqual(config.Runtime.DirLook.pane, p.settings.dir_look);
-}
-
test "over 9P a directory pane is a text pane whose name ends in /, its body the listing, ctl's isdir 1, and get reads it again" {
if (comptime !pardes.hosted) return;
const th = @import("ninep/testing.zig");
diff --git a/src/Output.zig b/src/Output.zig
index cee15dcd..e6a468ee 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -464,7 +464,7 @@ pub fn open(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []const u
/// Find and Grep share one +Search a directory, each run replacing what
/// the last showed, as acme reuses a directory's +Errors; a pane's own
-/// search (LookWord list) keeps a pane a pattern.
+/// search keeps a pane a pattern.
/// Whether `dir` has its Find/Grep +Search open.
pub fn hasFileSearch(p: *Pardes, dir: []const u8) bool {
for (p.panes) |slot| {
@@ -548,8 +548,8 @@ pub fn fillRows(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []con
const rf = if (rp.file) |*f| f else continue;
const o = if (rf.output) |*x| x else continue;
// A file search's rows share the directory's one +Search, and so do
- // word looks (`LookWord list`, a terminal's word: a look of a word
- // no file names, clicked or written): the next word refills it
+ // a terminal's word looks (a look of a word no file names, clicked
+ // or written): the next word refills it
// rather than stacking another. A `/` search keeps a +Search each,
// which n and N walk.
const terminal_word = p.word_look and from == .search and o.from == .search;
@@ -621,7 +621,7 @@ pub fn openDiff(p: *Pardes, id: usize, path: []const u8, content: []const u8) !u
/// Diff on a +Diff: the diff it stacks, as text. A pane holding it
/// already (the newest: a +Pager folded under its +Diff unfolds) is
-/// shown; else the file is opened as text, whatever DiffLook says.
+/// shown; else the file is opened as text.
pub fn showDiffText(p: *Pardes, id: usize, source: []const u8) void {
var newest: ?usize = null;
for (p.panes, 0..) |slot, i| {
diff --git a/src/config.zig b/src/config.zig
index 0e469c28..49dd4f78 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -113,17 +113,12 @@ pub const leader_path = paths: {
.Newcol = "cn",
.Delcol = "cd",
.Joincol = "cj",
- .Placement = "cp",
.SearchPlace = null,
.SearchPane = null,
.SearchRows = null,
.Search = null,
.Panes = null,
.More = null,
- .BootShell = null,
- .LookWord = null,
- .DirLook = null,
- .DiffLook = null,
.Pager = null,
.PagerColor = null,
.TermImages = null,
@@ -851,24 +846,6 @@ pub const Runtime = struct {
/// never, while the window has the focus, or always (ghostty's
/// custom-shader-animation).
shader_animation: ShaderAnimation = .on,
- /// Where a new pane goes (exec.placeNew): `acme`, acme's makenewwindow,
- /// or `pardes`, the rules pardes had before it.
- placement: Placement = .acme,
- /// A document dragged into the left column where a lone shell nobody
- /// has typed into stands: `keep` leaves the shell, `replace` closes it
- /// (exec.evictLonePristineTty).
- boot_shell: BootShell = .keep,
- /// A plain word looked at in a pane: `search`, acme's look3, selects its
- /// next place in that pane, wrapping; `list`, what pardes did before,
- /// lists every place in a +Search pane (look.zig, lookWord).
- look_word: LookWord = .search,
- /// A directory looked at: `pane`, acme's, a pane listing it (Dir.zig);
- /// `terminal`, what pardes did before, `ls` in a terminal there.
- dir_look: DirLook = .pane,
- /// A .diff or .patch looked at (a look, `pardes FILE`, `--wait`):
- /// `hunks`, a +Diff stacking its hunks (hunks.zig); `text`, the file
- /// itself, as pardes showed it before. Diff goes from one to the other.
- diff_look: DiffLook = .hunks,
/// What a terminal's shell pages through (host_io.ChildEnv): `pardes`,
/// PAGER and GIT_PAGER set to `pardes -`, a +Pager pane, where the
/// user's environment set neither; `off`, the environment as it is.
@@ -901,11 +878,6 @@ pub const Runtime = struct {
search_rows: u16 = 8,
pub const ShaderAnimation = enum { off, on, always };
- pub const Placement = enum { acme, pardes };
- pub const BootShell = enum { keep, replace };
- pub const LookWord = enum { search, list };
- pub const DirLook = enum { pane, terminal };
- pub const DiffLook = enum { hunks, text };
pub const Pager = enum { pardes, off };
pub const TermImages = enum { real, petscii };
pub const JumpScope = enum { file, all };
@@ -914,7 +886,7 @@ pub const Runtime = struct {
pub const SearchPlace = enum { attached, column };
pub const SearchPane = enum { reuse, new };
/// A setting that is one of a few words, each an enum field of Runtime.
- pub const Choice = enum { placement, boot_shell, look_word, dir_look, diff_look, pager, term_images, jump_scope, callstack_layout, callstack_corners, search_place, search_pane };
+ pub const Choice = enum { pager, term_images, jump_scope, callstack_layout, callstack_corners, search_place, search_pane };
/// shadow: a soft drop shadow. rim: a light hairline along the top of
/// the focused pane's tag rows. auto: a shadow on a light page; on a
@@ -1194,11 +1166,6 @@ pub const Runtime = struct {
.{ .word = "Grain", .action = .{ .scene = .grain }, .doc = "The page takes a fine, still grain, like paper: a level, 0 (off) through 3." },
.{ .word = "Shader", .action = .shader, .doc = "A Shadertoy file into the post chain, or out of it, compiled again when saved; off empties the chain." },
.{ .word = "ShaderAnimation", .action = .shader_animation, .doc = "When the post chain animates on its own: off, on (while focused) or always." },
- .{ .word = "Placement", .action = .{ .choice = .placement }, .doc = "Where a new pane goes: acme, as makenewwindow does, or pardes, the older rules." },
- .{ .word = "BootShell", .action = .{ .choice = .boot_shell }, .doc = "A document dropped where a lone untouched shell stands: keep the shell, or replace it." },
- .{ .word = "LookWord", .action = .{ .choice = .look_word }, .doc = "A plain word looked at: search selects its next place in the pane, list lists every place in a +Search." },
- .{ .word = "DiffLook", .action = .{ .choice = .diff_look }, .doc = "A .diff or .patch looked at: hunks, a +Diff stacking its hunks, or text, the file itself; Diff goes from one to the other." },
- .{ .word = "DirLook", .action = .{ .choice = .dir_look }, .doc = "A directory looked at: pane, a pane listing it as acme's directory window, or terminal, ls in a terminal there." },
.{ .word = "Pager", .action = .{ .choice = .pager }, .doc = "What a terminal's commands page through: pardes, a +Pager pane (pardes -), or off, the environment's own; for terminals started after it." },
.{ .word = "PagerColor", .action = .{ .toggle = .pager_color }, .doc = "A +Pager keeps its program's colours, on or off; for the next text paged." },
.{ .word = "TermImages", .action = .{ .choice = .term_images }, .doc = "How a new terminal draws its program's kitty graphics: real, as pixels where it can, or petscii, as glyph art." },
diff --git a/src/dump.zig b/src/dump.zig
index 9ceaa600..2cff503a 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -569,13 +569,11 @@ test "a dump keeps the session's settings, and a restore applies them" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true });
defer p.deinit();
- try std.testing.expect(p.executeBuiltinLine(p.active, "Placement pardes"));
try std.testing.expect(p.executeBuiltinLine(p.active, "Verbose off"));
try std.testing.expect(p.executeBuiltinLine(p.active, "JumpScope all"));
try dumpState(p);
const restored = try initFromDump(gpa, .{ .tty_only = true }, p.dump_out.?);
defer restored.deinit();
- try std.testing.expectEqual(config.Runtime.Placement.pardes, restored.settings.placement);
try std.testing.expect(!restored.settings.verbose);
try std.testing.expectEqual(config.Runtime.JumpScope.all, restored.settings.jump_scope);
}
diff --git a/src/exec.zig b/src/exec.zig
index de31624a..4706d11a 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -467,34 +467,6 @@ fn kindHost(z: [:0]const u8) ?std.Io.File.Kind {
return stat.kind;
}
-/// With `BootShell replace`, a doc landing in `col` closes a lone pristine
-/// shell there, the boot's placeholder, and absorbVWeight hands its space to
-/// the doc. With `keep`, the default, the shell stays like any other pane.
-pub fn evictLonePristineTty(p: *Pardes, col: usize, keep_id: usize) void {
- if (p.settings.boot_shell == .keep) return;
- var n_tty: usize = 0;
- var tty_id: usize = 0;
- for (0..p.col_n[col]) |k| {
- const cid = p.col_panes[col][k];
- if (p.panes[cid]) |ct| if (ct.isTerminal()) {
- n_tty += 1;
- tty_id = cid;
- };
- }
- if (n_tty != 1) return;
- const tt = p.panes[tty_id] orelse return;
- // No typing, cursor on the first prompt line, no scrollback: this is
- // the throwaway boot placeholder a document may replace.
- if (tt.ovl != null or panes.terminal.gridCursor(tt).y != 0 or
- panes.terminal.scrollbar(tt).total > tt.rows) return;
- p.deinitPane(tt) catch |err| return p.reportError(tty_id, "close", err);
- layout.compute(p); // a just-stacked doc has no rect yet; absorb snaps to rows
- _ = layout.absorbVWeight(p, tty_id, null);
- layout.removePane(p, tty_id);
- p.panes[tty_id] = null;
- if (p.active == tty_id) p.active = keep_id;
-}
-
// ---- REPLs ----
//
// A terminal is bound as a language's REPL by `Repl python` (builtins.zig).
@@ -1151,9 +1123,9 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
/// `scratch` is New's, `fs` 9P's pane/new, `errors` a +Errors pane.
pub const NewPane = enum { scratch, fs, shell, doc, command, errors };
-/// Put new pane `id` in the layout: every new pane comes through here, by
-/// the `Placement` setting, and every one but a command pane takes the
-/// keyboard. `from` is the pane that asked, `origin` the text it asked
+/// Put new pane `id` in the layout: every new pane comes through here, as
+/// acme's makenewwindow places it, and every one but a command pane takes
+/// the keyboard. `from` is the pane that asked, `origin` the text it asked
/// from: null when a column tag, the workspace tag or 9P asked (acme's
/// t->w == nil).
pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPane) void {
@@ -1172,21 +1144,18 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
layout.compute(p);
const before = p.rects;
const before_min = layout.minima(p);
- switch (p.settings.placement) {
- .acme => switch (kind) {
- // New: the bottom half of the last pane in its own column
- // (look.c:921-923, et->col).
- .scratch => layout.acmePlace(p, p.exec_column orelse columnOf(p, from), null, id),
- // +Errors, a command's output: the last column (util.c:94-98);
- // a command run from a column's tag, that column. The finder's
- // is never the last column for them.
- .command => layout.acmePlace(p, p.exec_column orelse p.ncol - 1, null, id),
- .errors => layout.acmePlace(p, away orelse p.ncol - 1, null, id),
- // makenewwindow(nil) for 9P's new (acme.c:877), else (t).
- .fs => layout.acmePlace(p, acmeColumn(p, from), null, id),
- .shell, .doc => layout.acmePlace(p, acmeColumn(p, from), asked, id),
- },
- .pardes => pardesPlace(p, from, id, kind),
+ switch (kind) {
+ // New: the bottom half of the last pane in its own column
+ // (look.c:921-923, et->col).
+ .scratch => layout.acmePlace(p, p.exec_column orelse columnOf(p, from), null, id),
+ // +Errors, a command's output: the last column (util.c:94-98); a
+ // command run from a column's tag, that column. The finder's is
+ // never the last column for them.
+ .command => layout.acmePlace(p, p.exec_column orelse p.ncol - 1, null, id),
+ .errors => layout.acmePlace(p, away orelse p.ncol - 1, null, id),
+ // makenewwindow(nil) for 9P's new (acme.c:877), else (t).
+ .fs => layout.acmePlace(p, acmeColumn(p, from), null, id),
+ .shell, .doc => layout.acmePlace(p, acmeColumn(p, from), asked, id),
}
// No pane is made shorter than its tag and two rows: where the place
// chosen has not the room, the column's tallest pane gives it, and
@@ -1274,90 +1243,6 @@ fn columnOf(p: *Pardes, id: usize) usize {
return if (layout.findPane(p, id)) |f| f.col else p.ncol - 1;
}
-/// The placements pardes had before it took acme's: an empty column whose
-/// tag asked, or has the keyboard, is filled; a scratch goes under the
-/// asking pane, a shell under it or the nearest pane with room, a document
-/// beside the last one read or in a column of its own, and a command pane
-/// at the foot of the last column.
-fn pardesPlace(p: *Pardes, from: usize, id: usize, kind: NewPane) void {
- const empty = if (p.exec_column orelse if (p.header_focus) p.header_column else null) |c|
- (if (c < p.ncol and p.col_n[c] == 0) c else null)
- else
- null;
- if (empty) |c| {
- layout.insert(p, c, 0, id);
- p.panes[id].?.vweight = 1;
- return;
- }
- const nt = p.panes[id].?;
- switch (kind) {
- .scratch, .fs => if (layout.findPane(p, from)) |sf| {
- layout.insert(p, sf.col, layout.groupEnd(p, sf.col, sf.idx), id);
- layout.splitBelow(p, from, nt);
- } else atFoot(p, id),
- .shell => belowParent(p, from, id),
- .doc, .errors => pardesDoc(p, from, id),
- .command => {
- const rc = p.exec_column orelse p.ncol - 1;
- if (p.col_n[rc] > 0) belowParent(p, p.col_panes[rc][p.col_n[rc] - 1], id) else layout.insert(p, rc, 0, id);
- },
- }
-}
-
-/// Where a pane goes when the one it would go under is in no column (Delcol
-/// took them all, or it was never placed): the foot of the active column,
-/// else of the last.
-fn atFoot(p: *Pardes, id: usize) void {
- const c = p.activeColumn() orelse p.ncol - 1;
- layout.insert(p, c, p.col_n[c], id);
- if (p.col_n[c] == 1) p.panes[id].?.vweight = 1;
-}
-
-fn belowParent(p: *Pardes, from: usize, id: usize) void {
- const parent = layout.splitParent(p, from);
- const f = layout.findPane(p, parent) orelse return atFoot(p, id);
- layout.insert(p, f.col, layout.groupEnd(p, f.col, f.idx), id);
- layout.splitBelow(p, parent, p.panes[id].?);
-}
-
-fn pardesDoc(p: *Pardes, from_id: usize, free: usize) void {
- const nt = p.panes[free].?;
- const doc = if (nt.file) |f| panes.Output.fileTraits(f.output).doc else true; // an image is a doc
- var src_id: ?usize = null;
- if (p.panes[from_id]) |src| if (if (src.file) |f| panes.Output.fileTraits(f.output).doc else src.image != null or src.hasPdf()) {
- src_id = from_id;
- };
- if (doc and src_id == null) {
- var n = p.njumps;
- while (n > 0) : (n -= 1) {
- const j = p.jumps[n - 1];
- const pp = p.panes[j.pane] orelse continue;
- if (pp.serial != j.serial) continue;
- if (if (pp.file) |f| panes.Output.fileTraits(f.output).doc else pp.image != null or pp.hasPdf()) {
- src_id = j.pane;
- break;
- }
- }
- }
- if (doc and src_id == null) for (p.panes, 0..) |sl, i| {
- if (sl) |pp| if (i != free and (if (pp.file) |f| panes.Output.fileTraits(f.output).doc else pp.image != null or pp.hasPdf())) {
- src_id = i;
- break;
- };
- };
- if (!doc) if (layout.findPane(p, from_id)) |sf| {
- layout.insert(p, sf.col, layout.groupEnd(p, sf.col, sf.idx), free);
- layout.splitBelow(p, from_id, nt); // NOT splitParent: no bystander pays
- return;
- };
- if (src_id == null and doc and p.ncol < MAX_COLS and
- layout.columnFitsHalves(p, from_id, 100) and layout.splitColumn(p, from_id, free, true))
- return;
- // Without room for a first-document column, split the Look origin
- // just like Term. Never displace (or evict) a top-left bystander.
- belowParent(p, src_id orelse from_id, free);
-}
-
test "the acme chords act once per selection, not once on the primary" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 30 });
diff --git a/src/hunks.zig b/src/hunks.zig
index ae7b5966..b30f09a6 100644
--- a/src/hunks.zig
+++ b/src/hunks.zig
@@ -715,7 +715,7 @@ test "a mailed patch keeps its headers, message and diffstat above its hunks" {
try testing.expectEqualStrings("From 0123 Mon Sep 17 00:00:00 2001\nSubject: [PATCH] change x\n\nWhy it changed.\n---\n x.txt | 2 +-\n\nx.txt:1\n-a\n+b\n", result.content);
}
-test "DiffLook hunks: a .patch looked at opens its +Diff; Diff goes to the text and back; DiffLook text opens the text" {
+test "a .patch looked at opens its +Diff, and Diff goes to the text and back" {
const p = try Pardes.init(testing.allocator, .{ .tty_only = true });
defer p.deinit();
var tmp = testing.tmpDir(.{});
@@ -737,7 +737,6 @@ test "DiffLook hunks: a .patch looked at opens its +Diff; Diff goes to the text
return n;
}
};
- try testing.expectEqual(pardes.config.Runtime.DiffLook.hunks, p.settings.diff_look);
pardes.look.lookAt(p, 0, patch);
try testing.expectEqual(@as(usize, 1), Count.of(p, hunks_path));
try testing.expectEqual(@as(usize, 0), Count.of(p, patch));
@@ -752,11 +751,6 @@ test "DiffLook hunks: a .patch looked at opens its +Diff; Diff goes to the text
// Diff on the text: the +Diff again, refilled, not another.
try testing.expect(p.executeBuiltinLine(raw, "Diff"));
try testing.expectEqual(@as(usize, 1), Count.of(p, hunks_path));
- // DiffLook text: a look opens the text (here the pane already open).
- try testing.expect(p.executeBuiltinLine(0, "DiffLook text"));
- try p.removePane(raw, null);
- pardes.look.lookAt(p, 0, patch);
- try testing.expectEqual(@as(usize, 1), Count.of(p, patch));
}
test "a hunk edited since, beside siblings with its signature's tail, is found in its own function" {
diff --git a/src/layout.zig b/src/layout.zig
index f545f60d..c7d7a189 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -989,21 +989,6 @@ pub fn absorbVWeight(p: *Pardes, id: usize, to: ?usize) ?usize {
return sib;
}
-pub fn splitParent(p: *Pardes, want: usize) usize {
- const need = 2 * (BOX_H + min_body_rows);
- if (p.rects[want].h >= need) return want;
- if (findPane(p, want)) |f| for (0..p.col_n[f.col]) |k| {
- if (p.rects[p.col_panes[f.col][k]].h >= need) return p.col_panes[f.col][k];
- };
- var tallest = want;
- for (0..p.ncol) |c| for (0..p.col_n[c]) |k| {
- const pid = p.col_panes[c][k];
- if (p.rects[pid].h >= need) return pid;
- if (p.rects[pid].h > p.rects[tallest].h) tallest = pid;
- };
- return tallest;
-}
-
pub fn splitBelow(p: *Pardes, src_id: usize, nw: *Pane) void {
const src = p.panes[src_id] orelse return;
const src_h = p.rects[src_id].h;
@@ -1196,12 +1181,6 @@ fn collapseGroup(p: *Pardes, c: usize, start: usize, end: usize) void {
compute(p);
}
-pub fn columnFitsHalves(p: *Pardes, source_id: usize, min_cells: u16) bool {
- const f = findPane(p, source_id) orelse return false;
- compute(p);
- return p.col_w[f.col] >= min_cells * 2;
-}
-
pub fn panelBox(rect: Rect) Box {
return .{
.x = @floatFromInt(rect.x),
diff --git a/src/look.zig b/src/look.zig
index 05cdd581..1f81d6ec 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1330,8 +1330,7 @@ fn settleLine(p: *Pardes, id: usize, path: []const u8, at: Spot, before: usize,
/// A plain word looked at in a pane, as acme's look3 does with one that
/// names no file (look.c:210, search): its next place in that pane after
-/// the dot, wrapping to the top, is selected there. No +Search pane
-/// (`LookWord list` lists every place in one instead).
+/// the dot, wrapping to the top, is selected there. No +Search pane.
fn lookWord(p: *Pardes, id: usize, pane: *Pane, word: []const u8) void {
const ninep_pane = @import("ninep/pane.zig");
const f = pane.file orelse return;
@@ -1390,7 +1389,7 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text:
if (pane.image != null or (pane.body.mode == .tty and !p.fs.serving)) return;
if (text.len == 0) return;
if (lookCommit(p, id, pane, trimmed)) return;
- if (p.settings.look_word == .search and pane.file != null) return lookWord(p, id, pane, text);
+ if (pane.file != null) return lookWord(p, id, pane, text);
p.word_look = true;
defer p.word_look = false;
const rows = runSearch(p, id, text, .cursor, false) catch |err| {
@@ -1826,21 +1825,8 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
var said: [4200]u8 = undefined;
return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch "look: no such directory");
};
- // acme's: a pane listing it (Dir.zig). `DirLook terminal`, what
- // pardes did before: `ls` in a terminal there.
- if (p.settings.dir_look == .pane) return panes.Dir.look(p, id, dir);
- for (p.panes, 0..) |slot, i| {
- if (slot) |tt| if (std.mem.eql(u8, tt.cwdSlice(), dir) and exec.takesCommandLine(p, i)) {
- clearNavigationSelection(p, tt);
- p.active = i;
- p.emitWrite(i, "ls\r");
- return;
- };
- }
- const free = p.freeSlot() orelse return p.reportError(id, "look", error.NoPaneSlots);
- const nt = p.newShell(free, dir) catch |err| return p.reportError(id, "look", err);
- nt.greet = true;
- exec.placeNew(p, id, id, free, .shell);
+ // acme's: a pane listing it (Dir.zig).
+ panes.Dir.look(p, id, dir);
},
.file => |target| {
if (comptime pdf_enabled) if (target.kind == .pdf) {
@@ -1872,9 +1858,9 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
var opened: ?usize = null;
if (!focusPaneByPath(p, target.path, target.at)) {
// A .diff or .patch looked at bare: its hunks stacked in a
- // +Diff (DiffLook hunks), which takes the keyboard as the
- // file would; one with none in it opens as text.
- if (p.settings.diff_look == .hunks and !p.look_text and target.at.line == 0 and
+ // +Diff, which takes the keyboard as the file would; one
+ // with none in it opens as text.
+ if (!p.look_text and target.at.line == 0 and
(std.mem.endsWith(u8, target.path, ".diff") or std.mem.endsWith(u8, target.path, ".patch")))
if (filesystem.read(p, target.path)) |bytes| {
defer p.gpa.free(bytes);
diff --git a/src/mouse.zig b/src/mouse.zig
index 4e0439fa..cb218a36 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -1250,12 +1250,6 @@ fn dragRelease(p: *Pardes, button: Mouse.Button) void {
.move => |d| {
layout.movePane(p, d.id, d.cur_x, d.cur_y);
if (layout.findPane(p, d.id)) |f| p.setActiveColumn(f.col);
- // BootShell replace: a file moved into the left column closes a
- // lone unused shell there
- if (p.panes[d.id]) |mt| if (mt.file != null) {
- if (layout.findPane(p, d.id)) |f| if (f.col == 0)
- exec.evictLonePristineTty(p, 0, d.id);
- };
},
.select => |s| {
const pane = p.panes[s.id] orelse return;
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index 0ee25345..833b25c5 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -564,23 +564,20 @@ test "a column's tag and the workspace's read, replace and append as a pane tag
}
test "a focus write makes its pane's column the active one: layout says so and pane/new goes there" {
- for ([_][]const u8{ "Placement acme", "Placement pardes" }) |placement| {
- const p = try th.withFile(testing.allocator, "x\n");
- defer p.deinit();
- try testing.expect(p.executeBuiltinLine(p.active, placement));
- const left = p.panes[0].?.serial;
- p.newColumn(p.active);
- p.newScratchFor(p.active, .fs); // fills the new, right column
- p.sync();
- try testing.expectEqual(@as(usize, 1), layout.findPane(p, p.active).?.col);
- var digits: [16]u8 = undefined;
- _ = th.wr(p, @backingInt(tree.TopFile.focus), try std.fmt.bufPrint(&digits, "{d}\n", .{left}));
- var want: [32]u8 = undefined;
- const text = th.rd(p, @backingInt(tree.TopFile.layout), 0, 4096).bytes;
- try testing.expect(std.mem.endsWith(u8, text, try std.fmt.bufPrint(&want, "active {d}\n", .{layout.columnSerial(p, 0)})));
- const made = th.call(p, .{ .tag = 1, .op = .open, .node = @backingInt(tree.TopFile.new) }).reply.handle;
- try testing.expectEqual(@as(usize, 0), layout.findPane(p, p.paneBySerial(made).?).?.col);
- }
+ const p = try th.withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const left = p.panes[0].?.serial;
+ p.newColumn(p.active);
+ p.newScratchFor(p.active, .fs); // fills the new, right column
+ p.sync();
+ try testing.expectEqual(@as(usize, 1), layout.findPane(p, p.active).?.col);
+ var digits: [16]u8 = undefined;
+ _ = th.wr(p, @backingInt(tree.TopFile.focus), try std.fmt.bufPrint(&digits, "{d}\n", .{left}));
+ var want: [32]u8 = undefined;
+ const text = th.rd(p, @backingInt(tree.TopFile.layout), 0, 4096).bytes;
+ try testing.expect(std.mem.endsWith(u8, text, try std.fmt.bufPrint(&want, "active {d}\n", .{layout.columnSerial(p, 0)})));
+ const made = th.call(p, .{ .tag = 1, .op = .open, .node = @backingInt(tree.TopFile.new) }).reply.handle;
+ try testing.expectEqual(@as(usize, 0), layout.findPane(p, p.paneBySerial(made).?).?.col);
}
test "a refused write after a truncation leaves every kind of tag as it was, and Dump still works" {
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index cb4cfa97..2a2131e3 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -91,7 +91,7 @@ pub fn run(p: *Pardes, id: usize, exec: bool, text: []const u8, in_tag: bool) vo
for (after.list[0..after.len]) |serial| if (std.mem.indexOfScalar(u32, before.list[0..before.len], serial) == null) {
// A query pane's +Preview is its query pane's: that answers.
if (p.paneBySerial(serial)) |made| if (p.panes[made].?.file) |f| if (f.output) |o| if (o.from == .preview) continue;
- // A look that made a +Search pane (LookWord list, a terminal)
+ // A look that made a +Search pane (a terminal's word)
// answers it: that is where the places it found are.
noteResult(p, serial);
created = true;
@@ -732,9 +732,9 @@ pub fn fillPager(p: *Pardes, serial: u32, held: *std.ArrayList(u8)) error{OutOfM
f.pager_spans = page.spans;
f.saved_revision = f.revision;
// A diff paged (`git show`, difftui's patches): its hunks stacked in a
- // +Diff (DiffLook hunks) in the +Pager's place, the +Pager closed. The
- // keyboard stays where it was, as a page's.
- if (f.pager_diff and p.settings.diff_look == .hunks) {
+ // +Diff in the +Pager's place, the +Pager closed. The keyboard stays
+ // where it was, as a page's.
+ if (f.pager_diff) {
const keyboard = p.active;
if (panes.Output.openDiff(p, id, f.path, f.content)) |hid| {
// ponytail: the text is gone with it; Diff on the +Diff says no such file.
@@ -954,7 +954,7 @@ pub fn writeFocus(p: *Pardes, req: Req) Reply {
const id = p.paneBySerial(serial) orelse return tree.failText(req.tag, E.NOENT, e_no_pane);
// The keyboard goes to the pane itself, off any header that had it, and
// its column becomes the active one, as the user's click there would
- // make it: pane/new and a look place there next, whatever Placement.
+ // make it: pane/new and a look place there next.
tagline.exitHeader(p);
p.active = id;
if (pardes.layout.findPane(p, id)) |at| p.setActiveColumn(at.col);
@@ -1429,7 +1429,7 @@ test "commands lists every builtin with its argument and the ctl that takes it"
var here: usize = 0;
for (std.enums.values(Builtin)) |b| here += @intFromBool(builtins.registry.here(p, b));
try testing.expectEqual(here, lines);
- for ([_][]const u8{ "\nDel arg pane -- ", "\nNewcol root -- ", "\nSave arg pane", "\nVerbose arg root on,off", "\nPlacement arg root acme,pardes", "\nUndo pane -- ", "\nEdit arg both -- acme's Edit" }) |row|
+ for ([_][]const u8{ "\nDel arg pane -- ", "\nNewcol root -- ", "\nSave arg pane", "\nVerbose arg root on,off", "\nUndo pane -- ", "\nEdit arg both -- acme's Edit" }) |row|
try testing.expect(std.mem.indexOf(u8, listed.bytes, row) != null);
}
@@ -2052,10 +2052,9 @@ test "a terminal told the directory it already goes by logs no rename" {
try testing.expect(th.logHas(p, try std.fmt.bufPrint(&rec, "rename {d} /usr", .{p.panes[term].?.serial})));
}
-test "a terminal with text typed at its prompt is never typed into: a look at its directory opens another" {
+test "a terminal with text typed at its prompt is never typed into: a look at its directory or an exec at it opens a pane of its own" {
const p = try th.withTerm(testing.allocator);
defer p.deinit();
- p.settings.dir_look = .terminal; // `ls` in a terminal, not a directory pane
const term = p.paneBySerial(serialOf(p)).?;
p.setCwd(term, "/tmp");
p.update(.{ .output = .{ .pane = @intCast(term), .bytes = "\x1b]133;A;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07TYPED" } });
@@ -2598,7 +2597,6 @@ test "every word's /commands description is its own doc comment's first sentence
"\nNewcol root -- An empty column right of the keyboard's, its tag taking the keyboard.\n",
"\nSave arg pane -- Write the pane's text to its file, or to the file its argument names.\n",
"\nVerbose arg root on,off -- A builtin says its own name on the message row as it runs, on or off.\n",
- "\nPlacement arg root acme,pardes -- Where a new pane goes: acme, as makenewwindow does, or pardes, the older rules.\n",
"\nKill arg root -- acme's Kill: stop the commands pardes started",
}) |row| try testing.expect(std.mem.indexOf(u8, listed, row) != null);
try testing.expect(std.mem.indexOf(u8, listed, ".c:") == null);
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index 6bd4e007..24de3e76 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -1827,7 +1827,6 @@ test "random placements, refused or not, leave no pane under its tag and two row
_ = try p.setTestFile("x\n");
while (p.nextEffect()) |_| {}
for (0..r.uintLessThan(usize, 3)) |_| _ = th.wr(p, Node.of(serialOf(p), .exec), "Newcol\n");
- if (r.boolean()) p.settings.placement = .pardes;
for (0..40) |step| {
var serials: [pardes.MAX_PANES]u32 = undefined;
var n: usize = 0;
diff --git a/src/pardes.zig b/src/pardes.zig
index aa458198..0dc0dc5f 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -965,47 +965,6 @@ test "a terminal respawned into a closed pane's slot hangs the old shell up firs
try std.testing.expect(closed and spawned);
}
-test "first document fallback splits like Term from the originating pane" {
- for ([_]u16{ 100, 198 }) |width| for (0..3) |from| {
- for ([_]bool{ false, true }) |collapsed| {
- const p = try Pardes.init(std.testing.allocator, .{ .cols = width, .rows = 62, .shells = 3 });
- defer p.deinit();
- const tty = try Pardes.init(std.testing.allocator, .{ .cols = width, .rows = 62, .shells = 3 });
- defer tty.deinit();
- p.settings.placement = .pardes;
- tty.settings.placement = .pardes;
- if (collapsed) {
- layout.toggleCollapse(p, from);
- layout.toggleCollapse(tty, from);
- }
- p.sync();
- tty.sync();
- const before = p.rects;
- const parent = layout.splitParent(p, from);
- const at = layout.findPane(p, parent).?;
- // The Look origin need not be the currently active pane.
- p.active = (from + 1) % 3;
- const free = p.freeSlot().?;
- _ = try p.openTutorView(free);
- exec.placeNew(p, from, from, free, .doc);
- _ = exec.spawnTty(tty, from);
- p.sync();
- tty.sync();
- try std.testing.expectEqual(@as(usize, 2), p.ncol);
- try std.testing.expectEqual(free, p.active);
- try std.testing.expectEqual(free, p.col_panes[at.col][at.idx + 1]);
- for (0..3) |id| {
- try std.testing.expect(p.panes[id] != null);
- if (id != parent) try std.testing.expectEqualDeep(before[id], p.rects[id]);
- }
- for (0..4) |id| try std.testing.expectEqualDeep(tty.rects[id], p.rects[id]);
- for (0..p.ncol) |col| {
- try std.testing.expectEqualSlices(usize, tty.col_panes[col][0..tty.col_n[col]], p.col_panes[col][0..p.col_n[col]]);
- }
- }
- };
-}
-
test "a frame no one watches is not drawn, and is drawn once someone does" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
@@ -1153,29 +1112,6 @@ test "the Tutor pane is named +Tutor in the session's directory, never a bare pa
while (p.nextEffect()) |e| try std.testing.expect(e != .save_file);
}
-test "first document keeps its originating shell and only opens a column when it fits" {
- for ([_]u16{ 199, 200 }) |width| {
- const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = width, .rows = 32 });
- defer p.deinit();
- p.settings.placement = .pardes;
- const shell = p.panes[0].?;
- _ = try p.openTutorView(1);
- exec.placeNew(p, 0, 0, 1, .doc);
- p.sync();
- try std.testing.expectEqual(shell, p.panes[0].?);
- try std.testing.expectEqual(@as(usize, 1), p.active);
- if (width < 200) {
- try std.testing.expectEqual(@as(usize, 1), p.ncol);
- try std.testing.expectEqualSlices(usize, &.{ 0, 1 }, p.col_panes[0][0..p.col_n[0]]);
- try std.testing.expectEqual(p.rects[0].y + p.rects[0].h, p.rects[1].y);
- } else {
- try std.testing.expectEqual(@as(usize, 2), p.ncol);
- try std.testing.expectEqual(@as(usize, 1), p.col_panes[0][0]);
- try std.testing.expectEqual(@as(usize, 0), p.col_panes[1][0]);
- }
- }
-}
-
test "an empty column shows its theme's empty_col under its tag: acme's white, else the border" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 20 });
defer p.deinit();
@@ -1195,24 +1131,6 @@ test "an empty column shows its theme's empty_col under its tag: acme's white, e
}
}
-test "BootShell keep leaves the untouched boot shell a dragged document joins; replace closes it" {
- inline for (.{ "keep", "replace" }) |word| {
- const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 });
- defer p.deinit();
- const shell = p.active;
- try std.testing.expect(p.panes[shell].?.isTerminal());
- try std.testing.expect(p.executeBuiltinLine(shell, "BootShell " ++ word));
- _ = try p.openTutorView(1);
- layout.insert(p, 0, 1, 1);
- p.sync();
- exec.evictLonePristineTty(p, 0, 1);
- p.sync();
- const kept = std.mem.eql(u8, word, "keep");
- try std.testing.expectEqual(kept, p.panes[shell] != null);
- try std.testing.expectEqual(@as(usize, if (kept) 2 else 1), p.col_n[0]);
- }
-}
-
test "dragging a column's only pane to another leaves that column in place, empty" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 160, .rows = 32 });
defer p.deinit();
@@ -1798,49 +1716,6 @@ test "image dump restores source bytes renderer choices and exact custom tail" {
try std.testing.expectEqualSlices(u8, source, again.panes[0].?.image.?.raw);
}
-test "a Look on a directory does not type ls into an occupied terminal" {
- const gpa = std.testing.allocator;
- const p = try Pardes.init(gpa, .{ .cols = 100, .rows = 30 });
- defer p.deinit();
- p.settings.dir_look = .terminal; // `ls` in a terminal, not a directory pane
- while (p.nextEffect()) |_| {}
-
- var realbuf: [4096]u8 = undefined;
- const tmp = look.resolve(null, "/tmp", "/", &realbuf).dir;
- p.setCwd(0, tmp);
- var host: FakeTtyQuery = .{};
- host.install(p);
- host.taken[0] = true;
- look.lookAt(p, 0, tmp);
-
- var spawned = false;
- while (p.nextEffect()) |effect| switch (effect) {
- .write => |w| if (w.pane == 0) return error.TypedLsIntoTheProgramOnTheTty,
- .spawn => spawned = true,
- else => {},
- };
- try std.testing.expect(spawned);
-
- // ...and the same look reuses that very pane once its program is gone: the
- // core keeps no state of its own about it, so recovery needs nothing reset
- host.taken[0] = false;
- look.lookAt(p, 0, tmp);
- var sent: [64]u8 = undefined;
- var sent_len: usize = 0;
- while (p.nextEffect()) |effect| switch (effect) {
- .write => |w| {
- try std.testing.expectEqual(@as(u8, 0), w.pane);
- try std.testing.expect(w.bytes.slice().len <= sent.len - sent_len);
- @memcpy(sent[sent_len..][0..w.bytes.slice().len], w.bytes.slice());
- sent_len += w.bytes.slice().len;
- },
- .spawn => return error.SpawnedDespiteAFreeTerminalOnTheDirectory,
- else => {},
- };
- try std.testing.expectEqualStrings("ls\r", sent[0..sent_len]);
- try std.testing.expectEqual(@as(usize, 0), p.active);
-}
-
test "a terminal its program gave back takes command lines again" {
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{});
@@ -4054,8 +3929,8 @@ pub const Pardes = struct {
chord_hold: bool = false,
/// The look just run found nothing (look.zig missed).
look_missed: bool = false,
- /// The look being run opens a .diff or .patch as text whatever DiffLook
- /// says: Diff going back from a +Diff, Edit's B (it edits the file).
+ /// The look being run opens a .diff or .patch as text, not its +Diff:
+ /// Diff going back from a +Diff, Edit's B (it edits the file).
look_text: bool = false,
look_hover_wait: ?look.LookHoverWait = null,
/// The place a look-hover last found nothing to open: the pointer
@@ -8057,7 +7932,6 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" {
if (platform == .web) return;
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 40 });
defer p.deinit();
- p.settings.placement = .pardes; // the neighbours below are what is under test
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
const top = p.active;
@@ -8086,14 +7960,14 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" {
try std.testing.expectEqual(low, p.active); // focus follows the rows
// Esc takes the question back and the pane stays; so does any other key,
- // and so does a click. (Top gets rows back first: split at its cursor,
- // it kept its tag and two, too few to give a pane below its own.)
- p.panes[top].?.vweight = p.panes[low].?.vweight;
+ // and so does a click. A New goes to the column's foot, under low, which
+ // is between two again.
+ p.newScratchBelow(low);
+ const foot = p.active;
+ const again = low;
+ p.active = again;
p.sync();
- p.newScratchBelow(top);
- const again = p.active;
- p.sync();
- h = .{ p.rects[top].h, p.rects[again].h, p.rects[low].h };
+ h = .{ p.rects[top].h, p.rects[again].h, p.rects[foot].h };
try std.testing.expect(p.executeBuiltinLine(again, "Msg keep"));
for ([_]Key{ .{ .cp = Key.escape }, .{ .cp = 'x' } }) |answer| {
p.update(.{ .key = .{ .cp = ' ' } });
@@ -8122,14 +7996,16 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" {
try std.testing.expect(p.panes[again] == null);
try std.testing.expectEqual(h[0] + h[1], p.rects[top].h);
try std.testing.expectEqual(top, p.active);
- try std.testing.expectEqual(h[2], p.rects[low].h);
+ try std.testing.expectEqual(h[2], p.rects[foot].h);
// A script answers the question on the pane's ctl, as the log's `ask`
// names it: `answer -` takes it back, a side closes the pane toward it.
+ p.newScratchBelow(foot);
+ const tail = p.active;
{
const th = @import("ninep/testing.zig");
- p.newScratchBelow(top);
- const asked = p.active;
+ const asked = foot;
+ p.active = asked;
p.sync();
const serial = p.panes[asked].?.serial;
const ctl = ctlfs.Node.of(serial, .ctl);
@@ -8152,20 +8028,21 @@ test "Del from a key asks which neighbour takes the rows; nothing else asks" {
// Bare Del from anything but a key closes at once and gives the rows up,
// as it always has.
- p.newScratchBelow(top);
- const third = p.active;
+ p.newScratchBelow(tail);
+ const last = p.active;
+ const third = tail;
p.sync();
- h = .{ p.rects[top].h, p.rects[third].h, p.rects[low].h };
+ h = .{ p.rects[top].h, p.rects[third].h, p.rects[last].h };
try std.testing.expect(p.executeBuiltinLine(third, "Del"));
p.sync();
try std.testing.expect(p.panes[third] == null);
try std.testing.expectEqual(h[0] + h[1], p.rects[top].h);
// With nothing open below, there is nothing to ask: SPC d closes at once.
- p.active = low;
+ p.active = last;
p.update(.{ .key = .{ .cp = ' ' } });
p.update(.{ .key = .{ .cp = 'd' } });
- try std.testing.expect(p.panes[low] == null);
+ try std.testing.expect(p.panes[last] == null);
}
test "the bare tty startup opens a text pane under the shell, unfocused" {
@@ -8298,7 +8175,6 @@ test "the Del question shows only once its delay is up: a quick SPC d j never se
if (platform == .web) return;
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 40 });
defer p.deinit();
- p.settings.placement = .pardes;
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
const top = p.active;