aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/inspector/widgets/page.zig
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 23:28:05 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-16 23:29:28 +0300
commit4a3302d19a2baa3a33e910e0088c24e780905b90 (patch)
treedcaf76fae1c82102d933c9225b17ca7ac5d3a847 /vendor/libghostty-vt/src/inspector/widgets/page.zig
parent550e9f8cc085f428429f5cf2da0bb2dba897e8b8 (diff)
chore: update vendored libghostty-vt
refs #276
Diffstat (limited to 'vendor/libghostty-vt/src/inspector/widgets/page.zig')
-rw-r--r--vendor/libghostty-vt/src/inspector/widgets/page.zig19
1 files changed, 14 insertions, 5 deletions
diff --git a/vendor/libghostty-vt/src/inspector/widgets/page.zig b/vendor/libghostty-vt/src/inspector/widgets/page.zig
index 844abc35..e332ab3c 100644
--- a/vendor/libghostty-vt/src/inspector/widgets/page.zig
+++ b/vendor/libghostty-vt/src/inspector/widgets/page.zig
@@ -25,8 +25,9 @@ pub fn inspector(page: *const terminal.Page) void {
/// the tree node is open or not. If it is open you must close it with
/// TreePop.
pub fn treeNode(state: struct {
- /// The page
- page: *const terminal.Page,
+ /// Page dimensions available without reading its backing memory.
+ cols: terminal.size.CellCountInt,
+ rows: terminal.size.CellCountInt,
/// The index of the page in a page list, used for headers.
index: usize,
/// The range of rows this page covers, inclusive.
@@ -34,6 +35,10 @@ pub fn treeNode(state: struct {
/// Whether this page is the active or viewport node.
active: bool,
viewport: bool,
+ /// Whether the page backing memory is currently compressed.
+ compressed: bool,
+ /// Dirty state is unavailable without restoring a compressed page.
+ dirty: ?bool,
}) bool {
// Setup our node.
const open = open: {
@@ -61,8 +66,8 @@ pub fn treeNode(state: struct {
// Metadata
cimgui.c.ImGui_TextDisabled(
"%dc x %dr",
- state.page.size.cols,
- state.page.size.rows,
+ state.cols,
+ state.rows,
);
cimgui.c.ImGui_SameLine();
cimgui.c.ImGui_Text("rows %d..%d", state.row_range[0], state.row_range[1]);
@@ -76,7 +81,11 @@ pub fn treeNode(state: struct {
cimgui.c.ImGui_SameLine();
cimgui.c.ImGui_TextColored(.{ .x = 0.4, .y = 0.8, .z = 1.0, .w = 1.0 }, "viewport");
}
- if (state.page.isDirty()) {
+ if (state.compressed) {
+ cimgui.c.ImGui_SameLine();
+ cimgui.c.ImGui_TextColored(.{ .x = 0.8, .y = 0.6, .z = 1.0, .w = 1.0 }, "compressed");
+ }
+ if (state.dirty orelse false) {
cimgui.c.ImGui_SameLine();
cimgui.c.ImGui_TextColored(.{ .x = 1.0, .y = 0.4, .z = 0.4, .w = 1.0 }, "dirty");
}