terminal: PageList rename "page" to "node" everywhere

This is more correct: a pagelist is a linked list of nodes, not pages.
The nodes themselves contain pages but we were previously calling the
nodes "pages" which was confusing, especially as I plan some future
changes to the way pages are stored.
This commit is contained in:
Mitchell Hashimoto
2024-11-06 14:15:31 -08:00
parent 7517d0a86b
commit aed51fd0b0
9 changed files with 591 additions and 588 deletions

View File

@@ -1040,7 +1040,7 @@ pub fn updateFrame(
null,
);
while (it.next()) |chunk| {
var dirty_set = chunk.page.data.dirtyBitSet();
var dirty_set = chunk.node.data.dirtyBitSet();
dirty_set.unsetAll();
}
}
@@ -2364,7 +2364,7 @@ fn rebuildCells(
// True if this cell is selected
const selected: bool = if (screen.selection) |sel|
sel.contains(screen, .{
.page = row.page,
.node = row.node,
.y = row.y,
.x = @intCast(
// Spacer tails should show the selection
@@ -2512,12 +2512,7 @@ fn rebuildCells(
);
};
if (style.flags.overline) self.addOverline(
@intCast(x),
@intCast(y),
fg,
alpha
) catch |err| {
if (style.flags.overline) self.addOverline(@intCast(x), @intCast(y), fg, alpha) catch |err| {
log.warn(
"error adding overline to cell, will be invalid x={} y={}, err={}",
.{ x, y, err },

View File

@@ -844,7 +844,7 @@ pub fn updateFrame(
null,
);
while (it.next()) |chunk| {
var dirty_set = chunk.page.data.dirtyBitSet();
var dirty_set = chunk.node.data.dirtyBitSet();
dirty_set.unsetAll();
}
}
@@ -1411,7 +1411,7 @@ pub fn rebuildCells(
// True if this cell is selected
const selected: bool = if (screen.selection) |sel|
sel.contains(screen, .{
.page = row.page,
.node = row.node,
.y = row.y,
.x = @intCast(
// Spacer tails should show the selection

View File

@@ -70,7 +70,7 @@ pub fn fgMode(
}
// If we are at the end of the screen its definitely constrained
if (cell_pin.x == cell_pin.page.data.size.cols - 1) break :text .constrained;
if (cell_pin.x == cell_pin.node.data.size.cols - 1) break :text .constrained;
// If we have a previous cell and it was PUA then we need to
// also constrain. This is so that multiple PUA glyphs align.

View File

@@ -122,7 +122,7 @@ pub const Set = struct {
if (!mouse_cell.hyperlink) return;
// Get our hyperlink entry
const page = &mouse_pin.page.data;
const page: *terminal.Page = &mouse_pin.node.data;
const link_id = page.lookupHyperlink(mouse_cell) orelse {
log.warn("failed to find hyperlink for cell", .{});
return;
@@ -165,7 +165,7 @@ pub const Set = struct {
for (row_pin.cells(.right), 0..) |*cell, x| {
const match = match: {
if (cell.hyperlink) {
if (row_pin.page.data.lookupHyperlink(cell)) |cell_link_id| {
if (row_pin.node.data.lookupHyperlink(cell)) |cell_link_id| {
break :match cell_link_id == link_id;
}
}
@@ -215,7 +215,7 @@ pub const Set = struct {
// Expand it to the left.
var it = mouse_pin.cellIterator(.left_up, null);
while (it.next()) |cell_pin| {
const page = &cell_pin.page.data;
const page: *terminal.Page = &cell_pin.node.data;
const rac = cell_pin.rowAndCell();
const cell = rac.cell;
@@ -241,7 +241,7 @@ pub const Set = struct {
// Expand it to the right
it = mouse_pin.cellIterator(.right_down, null);
while (it.next()) |cell_pin| {
const page = &cell_pin.page.data;
const page: *terminal.Page = &cell_pin.node.data;
const rac = cell_pin.rowAndCell();
const cell = rac.cell;