diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 23:08:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 23:20:24 -0300 |
| commit | 5c941c2278a4e099f3cd4bae1b29a783f88a95b0 (patch) | |
| tree | dabbe402d1319c53d2ba4ca05d6bef227b3e4704 | |
| parent | c9114545cce7f7598a4929d8254de1d3baccde84 (diff) | |
| download | pardes-5c941c2278a4e099f3cd4bae1b29a783f88a95b0.tar.gz pardes-5c941c2278a4e099f3cd4bae1b29a783f88a95b0.zip | |
Messages, Pick, Output: where jumps walk, SPC e lands an error's places as a list in the pane's walk through D's picker, and SPC h m is a picker over the history in the pane's tag (walk UI G item 2c, SPEC §10.4, §5.1's messages source), C's stopgaps replaced: SPC e (Messages.act) made a +Search under the pane and walked it with the Look walk; now, when Pick.asked (jumps walk, not a 9P script), it opens Pick's `list` with the places as rows, its word `✗ <cause>` (cut at a character's start to the word's 24 bytes), and lands its first row at once as the prototype's actOnMessage does (openPicker then accept): the pane steps (or its reader, the pane being held), the list word goes into its trail before the place, n and N walk the places through Pick.walkList; the history (Messages.history, from SPC e with nothing to act on and from the Messages word, SPC h m) is Pick's new source `messages`, its rows Output.messagesText (openMessages' text, split out), the newest first, a place indented under its error; Enter on a message row gives the keyboard to its cause's pane while it is open, on a place row Looks the place; C-q keeps it as the +Messages (Pick.keep); the source is not offered among the picker's other sources (its second row), as `list` is not; where jumps open panes, and for a 9P script, both are as C made them; the Message and Messages docs say so (builtins-{tui,gui}.json regenerated); TEST FIRST: Messages.zig 'where jumps walk, SPC e lands an error's places as a list in the pane's walk, n walking them; SPC h m is a picker over the history…' (no pane made, the caret on the first place and then the second, the word `✗ @p9 zig build 1/2` then `2/2` in the tag, the history's rows newest first, Enter on a message, C-q the +Messages); C's own SPC e test keeps the +Search way (jumps open panes there); GOLDENS: builtins (SPC h m's doc two rows longer: the rows under it, Tutor's among them, two lower; the +Look's line 237 for 236; tty_boot.zig's click on Tutor's row 32 for 30) and leader (the same doc rows in help-group), nothing else; tui core-test 1035/1204 (169 skipped), process-test 0 of 146 failed after those two updates (2 before them: those two)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | core/Messages.zig | 105 | ||||
| -rw-r--r-- | core/Output.zig | 27 | ||||
| -rw-r--r-- | core/Pick.zig | 39 | ||||
| -rw-r--r-- | core/builtins.zig | 15 | ||||
| -rw-r--r-- | docs/typ/builtins-gui.json | 4 | ||||
| -rw-r--r-- | docs/typ/builtins-tui.json | 4 | ||||
| -rw-r--r-- | test/process/tty_boot.zig | 6 | ||||
| -rw-r--r-- | test/snapshots/builtins.golden | 70 | ||||
| -rw-r--r-- | test/snapshots/leader.golden | 14 |
9 files changed, 206 insertions, 78 deletions
diff --git a/core/Messages.zig b/core/Messages.zig index 7cee0d25..c9166aed 100644 --- a/core/Messages.zig +++ b/core/Messages.zig @@ -521,19 +521,21 @@ pub fn answer(p: *Pardes, i: usize, key: u8) bool { } /// SPC e (the Message word, SPEC §10.4), on the message the notice row -/// leads with: an error that names places lists them in a +Search under -/// pane `id`, where n and N walk them, the first landed on, and the error -/// goes; a question takes the keyboard in its pane's tag; anything else, -/// or nothing, opens the history. +/// leads with: an error that names places lands them as a list in pane +/// `id`'s walk (Pick's `list`, its word `✗ <cause>` in the trail), the +/// first landed on, n and N walking the rest, and the error goes (a +/// +Search under the pane where jumps do not walk, or for a 9P script: +/// Pick.asked); a question takes the keyboard in its pane's tag; anything +/// else, or nothing, opens the history. pub fn act(p: *Pardes, id: usize) void { const m = &p.messages; - const lead = m.headline() orelse return openHistory(p, id); + const lead = m.headline() orelse return history(p, id); if (lead.kind == .question) { p.view().answering = lead.pane; p.needs_frame = true; return; } - if (lead.kind != .@"error" or lead.places_len == 0 or id >= MAX_PANES) return openHistory(p, id); + if (lead.kind != .@"error" or lead.places_len == 0 or id >= MAX_PANES) return history(p, id); const pane = p.panes[id] orelse return; var rows: std.Io.Writer.Allocating = .init(p.gpa); errdefer rows.deinit(); @@ -544,11 +546,26 @@ pub fn act(p: *Pardes, id: usize) void { } else return; m.remove(lead_at); const content = rows.toOwnedSlice() catch |err| return reportError(p, .at(id), "Message", err); + if (pardes.Pick.asked(p)) { + defer p.gpa.free(content); + // The cause cut at a character's start to the word's room. + const src = cause.slice(); + var cut = @min(src.len, 24 - "\u{2717} ".len); + while (cut > 0 and cut < src.len and src[cut] & 0xC0 == 0x80) cut -= 1; + var word: Buf(24) = .{}; + pardes.Pick.open(p, id, .list, word.print("\u{2717} {s}", .{src[0..cut]}), "", content); + return pardes.Pick.landHere(p); + } pardes.panes.Output.fillResults(p, id, pardes.panes.paneDir(pane), .search, cause.slice(), content, null) catch |err| return reportError(p, .at(id), "Message", err); _ = @import("look.zig").searchStep(p, id, 1); } -fn openHistory(p: *Pardes, id: usize) void { +/// The history (SPC h m, the Messages word; SPC e with nothing to act on): +/// where jumps walk a picker over it in pane `id`'s tag (Pick's +/// `messages`), the newest first, Enter Looking a row, C-q keeping it as +/// a +Messages; else (or for a 9P script, Pick.asked) the +Messages. +pub fn history(p: *Pardes, id: usize) void { + if (pardes.Pick.asked(p) and id < MAX_PANES and p.panes[id] != null) return pardes.Pick.open(p, id, .messages, "", "", ""); pardes.panes.Output.openMessages(p, id) catch |err| reportError(p, .at(id), "messages", err); } @@ -1379,13 +1396,81 @@ test "SPC e on an error that names places lists them under the pane and lands on _ = say(p, .notice, here, "older words"); _ = say(p, .warn, here, "newer words"); try std.testing.expect(p.executeBuiltinLine(here, "Message")); - const history = for (p.panes) |slot| { + const said_so_far = for (p.panes) |slot| { const shown = slot orelse continue; const f = shown.file orelse continue; if (std.mem.endsWith(u8, f.path, config.messages_buffer)) break f.content; } else return error.NoHistory; - const newer = std.mem.indexOf(u8, history, "! ") orelse return error.NoGlyph; - try std.testing.expect(newer < std.mem.indexOf(u8, history, "older words").?); + const newer = std.mem.indexOf(u8, said_so_far, "! ") orelse return error.NoGlyph; + try std.testing.expect(newer < std.mem.indexOf(u8, said_so_far, "older words").?); +} + +test "where jumps walk, SPC e lands an error's places as a list in the pane's walk, n walking them; SPC h m is a picker over the history in the pane's tag, the newest first, Enter on a message going to its cause, C-q keeping it as a +Messages" { + const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 30 }); + defer p.deinit(); + p.settings.jumps = .walk; + const pane = try p.setTestFile("one\ntwo\nthree\nfour\nfive\n"); + const id = p.view().active; + p.messages.live_len = 0; + const err = keep(p, .@"error", 0, "@p9 zig build", "exit 1"); + for ([_]u32{ 2, 4 }, 0..) |line, k| { + err.places[k] = .{ .line = line, .col = 1 }; + err.places[k].path.set("/test.txt"); + err.places[k].text.set("bad"); + } + err.places_len = 2; + var panes_before: usize = 0; + for (p.panes) |slot| panes_before += @intFromBool(slot != null); + for (" e") |c| p.update(.{ .key = .{ .cp = c } }); + while (p.nextEffect()) |_| {} + try std.testing.expect(p.messages.headline() == null); + // Landed in this reading pane, no pane made: on the first place, the + // list's word in its trail. + var panes_now: usize = 0; + for (p.panes) |slot| panes_now += @intFromBool(slot != null); + try std.testing.expectEqual(panes_before, panes_now); + try std.testing.expectEqual(id, p.view().active); + try std.testing.expectEqual(@as(i32, 1), pane.body.cur_row); + var frame = std.heap.ArenaAllocator.init(std.testing.allocator); + defer frame.deinit(); + try std.testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagText(p, frame.allocator(), pane), "\u{2717} @p9 zig build 1/2") != null); + // n: the next place, the word saying so. + p.update(.{ .key = .{ .cp = 'n' } }); + try std.testing.expectEqual(@as(i32, 3), pane.body.cur_row); + try std.testing.expect(std.mem.indexOf(u8, try pardes.tagline.tagText(p, frame.allocator(), pane), "\u{2717} @p9 zig build 2/2") != null); + // SPC h m: the history in this pane's tag, a row a message, the newest + // first; no pane made. + _ = say(p, .echo, id, "older"); + _ = say(p, .warn, id, "newest"); + for (" hm") |c| p.update(.{ .key = .{ .cp = c } }); + while (p.nextEffect()) |_| {} + try std.testing.expectEqual(pardes.TagState.Kind.pick, p.view().tag_state.kind); + const pk = pardes.Pick.live(p).?; + try std.testing.expectEqual(pardes.Pick.Source.messages, pk.source); + var marks: [256]u16 = undefined; + var nmarks: usize = 0; + // (Row 0 is the word's own echo, `Messages`, said as it ran.) + try std.testing.expect(std.mem.indexOf(u8, pk.names.row(1, &marks, &nmarks), "newest") != null); + try std.testing.expect(std.mem.indexOf(u8, pk.names.row(2, &marks, &nmarks), "older") != null); + // Enter on a message: its cause's pane has the keyboard, the picker + // rolled up; then the history again. + p.update(.{ .key = .{ .cp = Key.down } }); + p.update(.{ .key = .{ .cp = Key.enter } }); + while (p.nextEffect()) |_| {} + try std.testing.expectEqual(pardes.TagState.Kind.rest, p.view().tag_state.kind); + try std.testing.expectEqual(id, p.view().active); + for (" hm") |c| p.update(.{ .key = .{ .cp = c } }); + while (p.nextEffect()) |_| {} + try std.testing.expectEqual(pardes.TagState.Kind.pick, p.view().tag_state.kind); + // C-q: kept as the +Messages, the picker rolled up. + p.update(.{ .key = .{ .cp = 'q', .ctrl = true } }); + while (p.nextEffect()) |_| {} + try std.testing.expectEqual(pardes.TagState.Kind.rest, p.view().tag_state.kind); + panes_now = 0; + for (p.panes) |slot| panes_now += @intFromBool(slot != null); + try std.testing.expectEqual(panes_before + 1, panes_now); + const kept = p.panes[p.view().active].?; + try std.testing.expect(std.mem.endsWith(u8, kept.file.?.path, config.messages_buffer)); } test "Esc at rest takes a search's tints first, then the warnings and errors, and only then goes back" { diff --git a/core/Output.zig b/core/Output.zig index 32a00863..fe1543fe 100644 --- a/core/Output.zig +++ b/core/Output.zig @@ -986,26 +986,31 @@ pub fn openConfig(p: *Pardes, id: usize) !void { } /// The messages' history (the log ring), the newest first, each with its -/// kind's glyph, a live error's places under it (SPC h m). -pub fn openMessages(p: *Pardes, id: usize) !void { - var out: std.Io.Writer.Allocating = .init(p.gpa); - errdefer out.deinit(); +/// kind's glyph, a live error's places under it: the +Messages' text and +/// the Messages picker's rows (SPC h m). +pub fn messagesText(p: *Pardes, w: *std.Io.Writer) !void { var i: usize = p.messages.len; while (i > 0) { i -= 1; const m = p.messages.at(i).?; - try out.writer.print("{s} ", .{m.kind.glyph()}); - if (m.serial != 0) try out.writer.print("{d}: ", .{m.serial}); - try out.writer.writeAll(m.slice()); - if (m.repeats > 1) try out.writer.print(" (x{d})", .{m.repeats}); - try out.writer.writeByte('\n'); + try w.print("{s} ", .{m.kind.glyph()}); + if (m.serial != 0) try w.print("{d}: ", .{m.serial}); + try w.writeAll(m.slice()); + if (m.repeats > 1) try w.print(" (x{d})", .{m.repeats}); + try w.writeByte('\n'); for (p.messages.live[0..p.messages.live_len]) |*s| { if (s.kind != .@"error" or s.places_len == 0 or !std.mem.eql(u8, pardes.Messages.Message.body(s.text.slice()), pardes.Messages.Message.body(m.slice()))) continue; - for (s.places[0..s.places_len]) |*place| try out.writer.print(" {s}:{d}:{d} {s}\n", .{ place.path.slice(), place.line, place.col, place.text.slice() }); + for (s.places[0..s.places_len]) |*place| try w.print(" {s}:{d}:{d} {s}\n", .{ place.path.slice(), place.line, place.col, place.text.slice() }); break; } } - if (p.messages.len == 0) try out.writer.writeAll("nothing has been said yet\n"); + if (p.messages.len == 0) try w.writeAll("nothing has been said yet\n"); +} + +pub fn openMessages(p: *Pardes, id: usize) !void { + var out: std.Io.Writer.Allocating = .init(p.gpa); + errdefer out.deinit(); + try messagesText(p, &out.writer); const content = try out.toOwnedSlice(); return openRead(p, id, .{ .cmd = .Messages }, "", content); } diff --git a/core/Pick.zig b/core/Pick.zig index 7913a7e0..fa1c3230 100644 --- a/core/Pick.zig +++ b/core/Pick.zig @@ -46,9 +46,10 @@ const Key = pardes.Key; /// under the asking pane's directory, the lines of them holding the /// query, the files opened lately, the panes, the asking text's /// declarations, the lines holding the query in every open pane (All, its -/// places in each), the jump list, and rows handed over (a language -/// server's answer), titled by their word. -pub const Source = enum { find, grep, recent, panes, symbols, all, jumplist, list }; +/// places in each), the jump list, rows handed over (a language server's +/// answer, SPC e's places), titled by their word, and the messages' +/// history (SPC h m). +pub const Source = enum { find, grep, recent, panes, symbols, all, jumplist, list, messages }; /// Each source's word in the tag and the leader keys of the builtin that /// opens it, its key cells (`␣ f Find`). @@ -61,6 +62,7 @@ const words = std.EnumArray(Source, struct { word: []const u8, keys: []const u8 .all = .{ .word = "All", .keys = "" }, .jumplist = .{ .word = "Jumplist", .keys = "j" }, .list = .{ .word = "List", .keys = "l" }, + .messages = .{ .word = "Messages", .keys = "hm" }, }); /// The pickers kept after they roll up, for their list words and Resume. @@ -278,6 +280,12 @@ fn start(p: *Pardes, pk: *Pick) void { addRows(p, pk, out.written()); }, .list => addRows(p, pk, pk.rows), + .messages => { + var out: std.Io.Writer.Allocating = .init(p.gpa); + defer out.deinit(); + Output.messagesText(p, &out.writer) catch return; + addRows(p, pk, out.written()); + }, } } @@ -499,6 +507,24 @@ fn rowAt(p: *Pardes, pk: *const Pick, arena: std.mem.Allocator, i: usize) !Row { const path = if (t.path[0] == '/' or t.path[0] == '@') t.path else try std.Io.Dir.path.join(arena, &.{ dir, t.path }); row.target = .{ .place = .{ .path = path, .at = t.at } }; }, + // A message (`✗ 3: words`, Output.messagesText): its cause's pane + // while it is open; a place under it (indented): that place. + .messages => { + const lead = text.len - std.mem.trimStart(u8, text, " ").len; + if (lead == 0) { + const sp = std.mem.indexOfScalar(u8, text, ' ') orelse return row; + const digits = text[sp + 1 ..]; + const n = std.mem.indexOfNone(u8, digits, "0123456789") orelse return row; + if (n == 0 or digits[n] != ':') return row; + const serial = std.fmt.parseInt(u32, digits[0..n], 10) catch return row; + if (p.paneBySerial(serial) != null) row.target = .{ .pane = serial }; + return row; + } + const t = look.parsePathLine(text[lead..]); + row.pre = @intCast(lead + t.end); + if (t.path.len == 0) return row; + row.target = .{ .place = .{ .path = t.path, .at = t.at } }; + }, } return row; } @@ -553,7 +579,7 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !?TagState.Head { for (acts) |act| if (offered(pk, act)) try text.print(arena, "{s} ", .{act.word}); try text.appendSlice(arena, "|"); var first = false; - inline for (comptime std.enums.values(Source)) |src| if (src != .list) { + inline for (comptime std.enums.values(Source)) |src| if (src != .list and src != .messages) { if (src != pk.source) { if (!first) try text.append(arena, ' '); first = false; @@ -961,6 +987,11 @@ fn back(p: *Pardes, pk: *Pick) void { fn keep(p: *Pardes, pk: *Pick) void { const s = &p.view().tag_state; const from = p.paneBySerial(pk.owner) orelse p.view().active; + // The history kept is the +Messages (SPEC §10.4). + if (pk.source == .messages) { + TagState.toRest(p); + return Output.openMessages(p, from) catch |err| p.reportError(.at(from), "messages", err); + } var out: std.Io.Writer.Allocating = .init(p.gpa); defer out.deinit(); var arena = std.heap.ArenaAllocator.init(p.gpa); diff --git a/core/builtins.zig b/core/builtins.zig index 56cd1e67..1b35d75c 100644 --- a/core/builtins.zig +++ b/core/builtins.zig @@ -1724,8 +1724,9 @@ pub const LocationsConfig = struct { /// Act on the message the notice row leads with. /// -/// An error that names places lists them in a +Search, which the Look walk -/// steps through; a question takes the keyboard in its pane's tag (its +/// An error that names places lands them as a list in the pane's walk, n +/// and N walking them (where jumps do not walk, a +Search the Look walk +/// steps through); a question takes the keyboard in its pane's tag (its /// answer's key answers it, Esc leaves it waiting); anything else opens the /// history. pub const Message = struct { @@ -1736,13 +1737,17 @@ pub const Message = struct { } }; -/// Show the messages said so far in a +Messages, the newest first, an -/// error's places under it. +/// Show the messages said so far, the newest first, an error's places +/// under it. +/// +/// Where jumps walk, a list in the pane's tag: Enter Looks a row (a +/// message's cause, a place), C-q keeps it as a +Messages; else the +/// +Messages. pub const Messages = struct { pub const scope: Scope = .session; pub const output: OutputTraits = .{ .name = config.messages_buffer }; pub fn run(c: Ctx) void { - panes.Output.openMessages(c.p, c.id) catch |err| c.p.reportError(.at(c.id), "messages", err); + pardes.Messages.history(c.p, c.id); } }; diff --git a/docs/typ/builtins-gui.json b/docs/typ/builtins-gui.json index a4016429..6466a845 100644 --- a/docs/typ/builtins-gui.json +++ b/docs/typ/builtins-gui.json @@ -69,9 +69,9 @@ {"name": "LookPrev", "leader": "SPC j p", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Select the previous thing a Look would open, as LookNext walks forward.", "text": "Select the previous thing a Look would open, as LookNext walks forward.\nEnter opens what it selected."}, {"name": "Lspinfo", "leader": "SPC l i", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Show which index and language server serve this file, and their state, in a +Lsp.", "text": "Show which index and language server serve this file, and their state, in a +Lsp.\nThe index.scip it asks (or the Index that would write one), its server and the server's state (not started yet, failed and waiting to retry), and what answered each query lately."}, {"name": "Lspwhy", "leader": "SPC l w", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Explain, step by step in a +Lsp, how the last language server request was answered.", "text": "Explain, step by step in a +Lsp, how the last language server request was answered."}, - {"name": "Message", "leader": "SPC e", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Act on the message the notice row leads with.", "text": "Act on the message the notice row leads with.\nAn error that names places lists them in a +Search, which the Look walk steps through; a question takes the keyboard in its pane's tag (its answer's key answers it, Esc leaves it waiting); anything else opens the history."}, + {"name": "Message", "leader": "SPC e", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Act on the message the notice row leads with.", "text": "Act on the message the notice row leads with.\nAn error that names places lands them as a list in the pane's walk, n and N walking them (where jumps do not walk, a +Search the Look walk steps through); a question takes the keyboard in its pane's tag (its answer's key answers it, Esc leaves it waiting); anything else opens the history."}, {"name": "MessageLinger", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": null, "doc": "How long, in milliseconds, an echo or a notice stays bright before it dims; a warning twice as long.", "text": "How long, in milliseconds, an echo or a notice stays bright before it dims; a warning twice as long."}, - {"name": "Messages", "leader": "SPC h m", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Show the messages said so far in a +Messages, the newest first, an error's places under it.", "text": "Show the messages said so far in a +Messages, the newest first, an error's places under it."}, + {"name": "Messages", "leader": "SPC h m", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Show the messages said so far, the newest first, an error's places under it.", "text": "Show the messages said so far, the newest first, an error's places under it.\nWhere jumps walk, a list in the pane's tag: Enter Looks a row (a message's cause, a place), C-q keeps it as a +Messages; else the +Messages."}, {"name": "Mini", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Map a file of this pane's directory in braille dots: `Mini notes.txt`.", "text": "Map a file of this pane's directory in braille dots: `Mini notes.txt`.\nA pane of its own, drawn once: a Mini of the same file again draws it anew."}, {"name": "Mode", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Step this pane to its next input mode: normal, insert, and in a terminal raw.", "text": "Step this pane to its next input mode: normal, insert, and in a terminal raw.\nFrom the last it goes back to normal. The keyboard goes to the pane's text."}, {"name": "More", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Let a query pane's Grep stopped at its 2000 lines go on for 2000 more.", "text": "Let a query pane's Grep stopped at its 2000 lines go on for 2000 more."}, diff --git a/docs/typ/builtins-tui.json b/docs/typ/builtins-tui.json index 38d87b19..70d7c73d 100644 --- a/docs/typ/builtins-tui.json +++ b/docs/typ/builtins-tui.json @@ -65,9 +65,9 @@ {"name": "LookPrev", "leader": "SPC j p", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Select the previous thing a Look would open, as LookNext walks forward.", "text": "Select the previous thing a Look would open, as LookNext walks forward.\nEnter opens what it selected."}, {"name": "Lspinfo", "leader": "SPC l i", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Show which index and language server serve this file, and their state, in a +Lsp.", "text": "Show which index and language server serve this file, and their state, in a +Lsp.\nThe index.scip it asks (or the Index that would write one), its server and the server's state (not started yet, failed and waiting to retry), and what answered each query lately."}, {"name": "Lspwhy", "leader": "SPC l w", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Explain, step by step in a +Lsp, how the last language server request was answered.", "text": "Explain, step by step in a +Lsp, how the last language server request was answered."}, - {"name": "Message", "leader": "SPC e", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Act on the message the notice row leads with.", "text": "Act on the message the notice row leads with.\nAn error that names places lists them in a +Search, which the Look walk steps through; a question takes the keyboard in its pane's tag (its answer's key answers it, Esc leaves it waiting); anything else opens the history."}, + {"name": "Message", "leader": "SPC e", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Act on the message the notice row leads with.", "text": "Act on the message the notice row leads with.\nAn error that names places lands them as a list in the pane's walk, n and N walking them (where jumps do not walk, a +Search the Look walk steps through); a question takes the keyboard in its pane's tag (its answer's key answers it, Esc leaves it waiting); anything else opens the history."}, {"name": "MessageLinger", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": null, "doc": "How long, in milliseconds, an echo or a notice stays bright before it dims; a warning twice as long.", "text": "How long, in milliseconds, an echo or a notice stays bright before it dims; a warning twice as long."}, - {"name": "Messages", "leader": "SPC h m", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Show the messages said so far in a +Messages, the newest first, an error's places under it.", "text": "Show the messages said so far in a +Messages, the newest first, an error's places under it."}, + {"name": "Messages", "leader": "SPC h m", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Show the messages said so far, the newest first, an error's places under it.", "text": "Show the messages said so far, the newest first, an error's places under it.\nWhere jumps walk, a list in the pane's tag: Enter Looks a row (a message's cause, a place), C-q keeps it as a +Messages; else the +Messages."}, {"name": "Mini", "leader": null, "also": [], "arg": true, "scope": "pane", "setting": false, "choices": null, "doc": "Map a file of this pane's directory in braille dots: `Mini notes.txt`.", "text": "Map a file of this pane's directory in braille dots: `Mini notes.txt`.\nA pane of its own, drawn once: a Mini of the same file again draws it anew."}, {"name": "Mode", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Step this pane to its next input mode: normal, insert, and in a terminal raw.", "text": "Step this pane to its next input mode: normal, insert, and in a terminal raw.\nFrom the last it goes back to normal. The keyboard goes to the pane's text."}, {"name": "More", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Let a query pane's Grep stopped at its 2000 lines go on for 2000 more.", "text": "Let a query pane's Grep stopped at its 2000 lines go on for 2000 more."}, diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig index e342ea46..1e52a468 100644 --- a/test/process/tty_boot.zig +++ b/test/process/tty_boot.zig @@ -155,9 +155,9 @@ fn builtins(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.stable(700, 15000); try t.snap("docs-group"); // Tutor's row, under the documentation of the four before it (Keys, - // describe-key, is SPC h k) - try t.press("middle", "@Tutor", 30); - try t.release("middle", "@Tutor", 30); + // describe-key, is SPC h k; Messages' runs to three rows) + try t.press("middle", "@Tutor", 32); + try t.release("middle", "@Tutor", 32); try t.wait(10000, "PARDES TUTOR"); try t.stable(700, 15000); try t.snap("tutor-from-index"); diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden index 81a445e1..89c678f1 100644 --- a/test/snapshots/builtins.golden +++ b/test/snapshots/builtins.golden @@ -91,7 +91,7 @@ |30: ~ |56: +Search 1/1 Save Undock Del |57: /^ +Look -|58: @p2:236:1 Look enter, right-click +|58: @p2:237:1 Look enter, right-click |66: ✓ /tmp/pardes-snap/builtins/cwd/notes.txt Help 3 messages · SPC h m == snap docs-group grid=120x67 cursor=7,10 |10: 1 pardes builtins under SPC h @@ -109,39 +109,39 @@ |24: m, z, Z, [, ], window mode's C-w. A sequence nothing is bound to is shown struck, `runs nothing`. Esc leaves it. |25: 13 |26: 14 SPC h m Messages -|27: 15 Show the messages said so far in a +Messages, the newest first, an error's places under it. -|28: 16 -|29: 17 SPC h t Tutor topbar -|30: 18 Open the tutor, a document to work through. -|31: 19 -|32: ~ +|27: 15 Show the messages said so far, the newest first, an error's places under it. +|28: 16 Where jumps walk, a list in the pane's tag: Enter Looks a row (a message's cause, a place), C-q keeps it as a +M↩ +|29: essages; else the +Messages. +|30: 17 +|31: 18 SPC h t Tutor topbar +|32: 19 Open the tutor, a document to work through. +|33: 20 +|34: ~ |66: ✓ /tmp/pardes-snap/builtins/cwd/notes.txt Help 5 messages · SPC h m -== snap tutor-from-index grid=120x67 cursor=7,43 -|32: +Search 1/1 Save Undock Del -|33: /^ +Look -|34: @p2:236:1 Look enter, right-click -|42: /tmp/pardes-snap/builtins/cwd/+Tutor Save Term Collapse Follow Del -|43: 1 -|44: 2 PARDES TUTOR -|45: 3 -|46: 4 This pane is +Tutor, a copy: edit it freely; there is no need to -|47: 5 Save it (a bare Save asks for a path to write a copy to). -|48: 6 `Del` in its tag closes it; once you have edited it, `Del` refuses -|49: 7 once and the second `Del` discards. `Tutor` or SPC h t opens a -|50: 8 fresh copy. -|51: 9 -|52: 10 The guide (docs/typ/guide.typ) explains; this is the hands-on part. -|53: 11 Each lesson is a few things to do, then names its guide section. -|54: 12 Words in backticks, like `Save`, are builtins. -|55: 13 `Exec` (B2) runs the builtin a word names, or else runs it as a -|56: 14 shell line; `Look` (B3) opens what the text names, or else finds -|57: 15 it. Type a builtin in any tag and `Exec` it. Lines starting with -|58: 16 "| " are tags. -|59: 17 -|60: 18 Press j until you reach part 1. -|61: 19 -|62: 20 -|63: 21 ================================================================= -|64: 22 = PART 1 — MODES = -|65: 23 ================================================================= +== snap tutor-from-index grid=120x67 cursor=7,45 +|34: +Search 1/1 Save Undock Del +|35: /^ +Look +|36: @p2:237:1 Look enter, right-click +|44: /tmp/pardes-snap/builtins/cwd/+Tutor Save Term Collapse Follow Del +|45: 1 +|46: 2 PARDES TUTOR +|47: 3 +|48: 4 This pane is +Tutor, a copy: edit it freely; there is no need to +|49: 5 Save it (a bare Save asks for a path to write a copy to). +|50: 6 `Del` in its tag closes it; once you have edited it, `Del` refuses +|51: 7 once and the second `Del` discards. `Tutor` or SPC h t opens a +|52: 8 fresh copy. +|53: 9 +|54: 10 The guide (docs/typ/guide.typ) explains; this is the hands-on part. +|55: 11 Each lesson is a few things to do, then names its guide section. +|56: 12 Words in backticks, like `Save`, are builtins. +|57: 13 `Exec` (B2) runs the builtin a word names, or else runs it as a +|58: 14 shell line; `Look` (B3) opens what the text names, or else finds +|59: 15 it. Type a builtin in any tag and `Exec` it. Lines starting with +|60: 16 "| " are tags. +|61: 17 +|62: 18 Press j until you reach part 1. +|63: 19 +|64: 20 +|65: 21 ================================================================= |66: ✓ /tmp/pardes-snap/builtins/cwd/+Help Tutor 7 messages · SPC h m diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden index 2714ad2c..b341731d 100644 --- a/test/snapshots/leader.golden +++ b/test/snapshots/leader.golden @@ -77,12 +77,14 @@ |21: is bound to is shown struck, `runs nothing`. Esc leaves it. |22: 13 |23: 14 SPC h m Messages -|24: 15 Show the messages said so far in a +Messages, the newest first, an error's places under it. -|25: 16 -|26: 17 SPC h t Tutor topbar -|27: 18 Open the tutor, a document to work through. -|28: 19 -|29: ~ +|24: 15 Show the messages said so far, the newest first, an error's places under it. +|25: 16 Where jumps walk, a list in the pane's tag: Enter Looks a row (a message's cause, a place), ↩ +|26: C-q keeps it as a +Messages; else the +Messages. +|27: 17 +|28: 18 SPC h t Tutor topbar +|29: 19 Open the tutor, a document to work through. +|30: 20 +|31: ~ |40: ✓ /tmp/pardes-snap/leader/cwd/cmds.txt Help 4 messages · SPC h m == snap tutor grid=100x41 cursor=7,23 |22: /tmp/pardes-snap/leader/cwd/+Tutor Save Term Collapse Follow Del |
