summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 23:19:12 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit639a2a7931394742af2a2e6f02006fdfd4dd6052 (patch)
tree664284d5f5cdf597f4a8979598ed1b35a7a1d958 /src/terminal.zig
parent2ab8acae32ea4f1a0988f2f1f0841f7e7ac99e93 (diff)
downloadpardes-639a2a7931394742af2a2e6f02006fdfd4dd6052.tar.gz
pardes-639a2a7931394742af2a2e6f02006fdfd4dd6052.zip
text: a terminal's edit overlay and its undo are the Text's: EditBuffer, Snapshot and history_max move from terminal.zig into Text.zig, as they are, so Text names no terminal type (terminal.zig and panes.zig's ovl name them there, as test/panes.zig does); a move, nothing else
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index 46790de1..4ee2e9fa 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -16,7 +16,9 @@ const File = panes.File;
const ghostty_vt = @import("ghostty-vt");
-pub const history_max = 64;
+const EditBuffer = panes.Text.EditBuffer;
+const Snapshot = panes.Text.Snapshot;
+const history_max = panes.Text.history_max;
pub const VtSlot = ghostty_vt.Terminal;
/// A cell of an emulator's pages, as `getCell` reads it (src/echo.zig).
@@ -416,23 +418,6 @@ fn asGhostRgb(rgb: [3]u8) GColor.RGB {
return .{ .r = rgb[0], .g = rgb[1], .b = rgb[2] };
}
-/// The owned text standing in for `rows` live terminal rows, beginning at
-/// absolute surface row `row`. The emulator grid remains untouched underneath.
-pub const EditBuffer = struct {
- row: i32 = 0,
- rows: i32 = 1,
- text: []u8 = &.{},
-};
-
-/// One whole-state terminal edit boundary. Null means the pane has not yet
-/// materialized an edit buffer; non-null snapshots own their text.
-pub const Snapshot = struct {
- ovl: ?EditBuffer,
- cur_row: i32,
- cur_col: i32,
- vsel: panes.Text.CharSel,
-};
-
pub const PendingCommand = struct {
bytes: []u8 = &.{},
wait: enum { none, spawn, input } = .none,