mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
terminal/page: use addWithIdContext when cloning hyperlink data
This commit is contained in:
@ -684,11 +684,12 @@ pub const Page = struct {
|
|||||||
// add it, and migrate.
|
// add it, and migrate.
|
||||||
const id = other.lookupHyperlink(src_cell).?;
|
const id = other.lookupHyperlink(src_cell).?;
|
||||||
const other_link = other.hyperlink_set.get(other.memory, id);
|
const other_link = other.hyperlink_set.get(other.memory, id);
|
||||||
const dst_id = try self.hyperlink_set.addContext(
|
const dst_id = try self.hyperlink_set.addWithIdContext(
|
||||||
self.memory,
|
self.memory,
|
||||||
try other_link.dupe(other, self),
|
try other_link.dupe(other, self),
|
||||||
|
id,
|
||||||
.{ .page = self },
|
.{ .page = self },
|
||||||
);
|
) orelse id;
|
||||||
try self.setHyperlink(dst_row, dst_cell, dst_id);
|
try self.setHyperlink(dst_row, dst_cell, dst_id);
|
||||||
}
|
}
|
||||||
if (src_cell.style_id != style.default_id) {
|
if (src_cell.style_id != style.default_id) {
|
||||||
@ -705,13 +706,11 @@ pub const Page = struct {
|
|||||||
// Slow path: Get the style from the other
|
// Slow path: Get the style from the other
|
||||||
// page and add it to this page's style set.
|
// page and add it to this page's style set.
|
||||||
const other_style = other.styles.get(other.memory, src_cell.style_id);
|
const other_style = other.styles.get(other.memory, src_cell.style_id);
|
||||||
if (try self.styles.addWithId(
|
dst_cell.style_id = try self.styles.addWithId(
|
||||||
self.memory,
|
self.memory,
|
||||||
other_style.*,
|
other_style.*,
|
||||||
src_cell.style_id,
|
src_cell.style_id,
|
||||||
)) |id| {
|
) orelse src_cell.style_id;
|
||||||
dst_cell.style_id = id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user