summaryrefslogtreecommitdiff
path: root/src/panes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/panes.zig')
-rw-r--r--src/panes.zig52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/panes.zig b/src/panes.zig
index d4b336d7..8049da4e 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -24,6 +24,9 @@ const Key = pardes.Key;
pub const EditText = struct { text: []u8, row0: i32 };
pub const Pane = struct {
+ /// The words that throw unsaved text away (builtins.zig warnModified).
+ pub const Discarding = enum { Exit, Restore };
+
/// One mouse selection (block-shaped), per button. c/r are text-area relative;
/// r counts from the tag's first row (the body starts at Pane.tag_rows).
pub const Sel = struct {
@@ -69,6 +72,10 @@ pub const Pane = struct {
/// Del from the keyboard with open panes both above and below: which
/// one takes the rows. Nothing is typed; one key answers.
del_side,
+ /// An exec from a file's body with several REPLs bound for its
+ /// language: which one takes it (exec.zig routeToRepl). One key
+ /// answers, the question being in `question`.
+ repl_choice,
/// A new name for the file, drafted in place of the path on the
/// tagline after a click there; Enter commits it, as a buffer name
/// and never a disk rename.
@@ -99,9 +106,39 @@ pub const Pane = struct {
/// middle click, a pty/run): its first word, which Kill matches, and
/// the shell's command count its start (C mark) reaches.
sent_command: ?struct { word: [64]u8 = undefined, len: u8 = 0, seq: u32 = 0 } = null,
+ /// A command pane (exec.zig runCommand): the line its child runs as
+ /// `$SHELL -c`, owned, where an interactive terminal has null.
+ command: ?[]u8 = null,
+ /// The command's child has exited, and with what status (null: unknown,
+ /// shown `exit ?`).
+ command_done: bool = false,
+ command_status: ?u8 = null,
+ /// Its pty is still open: a job the command left in the background may
+ /// be printing to it, and a reuse would hang it up.
+ command_pty: bool = false,
+ /// The shell a terminal runs when it is not the configured one (`Tty
+ /// fish`), owned.
+ shell: ?[]u8 = null,
+ /// An interactive terminal's tag text naming its shell, ` Tty+fish ...`
+ /// (Pardes.acknowledgeShell); empty until the host says which it ran.
+ shell_tail: [96]u8 = undefined,
+ shell_tail_len: u8 = 0,
+ /// A terminal bound as a language's REPL (`Repl python`): an exec from
+ /// the body of a file in that language is sent to it (exec.zig
+ /// routeToRepl). `letter` makes its id, `python-a`, with the language's
+ /// name from grammar_manifest.
+ repl: ?struct { lang: u8, letter: u8 } = null,
+ /// It has been told that its program takes no bracketed paste.
+ repl_warned: bool = false,
+ /// A question with its answers in it (`repl_choice`).
+ question: [96]u8 = undefined,
+ question_len: u8 = 0,
+ /// The newest message says where an exec was sent: it is tinted.
+ msg_sent: bool = false,
/// The revision an Exit or a Restore last warned this pane was modified
- /// at (builtins.zig warnModified).
- discard_warned: ?u32 = null,
+ /// at, and which of them: only that word goes ahead on the warning
+ /// (builtins.zig warnModified).
+ discard_warned: ?struct { revision: u32, by: Discarding } = null,
/// Native host queues the Linux v9fs launcher in this pane's initial shell.
v9fs_on_spawn: bool = false,
file: ?File.State = null,
@@ -120,9 +157,13 @@ pub const Pane = struct {
search_pane: ?usize = null,
search_row: ?usize = null,
look_at: ?LookSpot = null,
+ /// `gw`'s words, labelled in order while it waits for a label to be
+ /// typed (gpa-owned); `jump_first` is the label's first letter once typed.
+ jump: std.ArrayList(modal.Selection) = .empty,
+ jump_first: ?u8 = null,
sel_snap: [Text.max_selections]modal.Selection = undefined,
- nsel_snap: u8 = 0,
- sel_snap_pri: u8 = 0,
+ nsel_snap: u16 = 0,
+ sel_snap_pri: u16 = 0,
sel_snap_expl: bool = false,
/// The tag: what the user keeps after the computed prefix (the path, the
/// dirty marker, a PDF's page), its cursor, selections and undo. The
@@ -168,6 +209,8 @@ pub const Pane = struct {
msg_len: u16 = 0,
/// Where the newest message line is in its life.
msg_life: MessageLife = .{},
+ /// When it was said, in monotonic ms (Messages.expireUnattended).
+ msg_said_ms: i64 = 0,
/// The row (among the notice rows) the newest line holds for its life.
msg_slot: u8 = 0,
/// Earlier message lines still on screen, oldest first, each running its
@@ -340,6 +383,7 @@ pub const Pane = struct {
return switch (p.prompt) {
.none, .name => null,
.del_side => config.del_question,
+ .repl_choice => p.question[0..p.question_len],
else => p.input.own orelse "",
};
}