mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
terminal: printCell writes with the current pen's content type
This commit is contained in:
@@ -134,6 +134,10 @@ pub const Cursor = struct {
|
||||
/// because its most likely null.
|
||||
hyperlink: ?*hyperlink.Hyperlink = null,
|
||||
|
||||
/// The current semantic content type for the cursor that will be
|
||||
/// applied to any newly written cells.
|
||||
semantic_content: pagepkg.Cell.SemanticContent = .output,
|
||||
|
||||
/// The pointers into the page list where the cursor is currently
|
||||
/// located. This makes it faster to move the cursor.
|
||||
page_pin: *PageList.Pin,
|
||||
|
||||
@@ -711,6 +711,7 @@ fn printCell(
|
||||
.style_id = self.screens.active.cursor.style_id,
|
||||
.wide = wide,
|
||||
.protected = self.screens.active.cursor.protected,
|
||||
.semantic_content = self.screens.active.cursor.semantic_content,
|
||||
};
|
||||
|
||||
if (style_changed) {
|
||||
@@ -11236,6 +11237,7 @@ test "Terminal: fullReset with a non-empty pen" {
|
||||
|
||||
try t.setAttribute(.{ .direct_color_fg = .{ .r = 0xFF, .g = 0, .b = 0x7F } });
|
||||
try t.setAttribute(.{ .direct_color_bg = .{ .r = 0xFF, .g = 0, .b = 0x7F } });
|
||||
t.screens.active.cursor.semantic_content = .input;
|
||||
t.fullReset();
|
||||
|
||||
{
|
||||
@@ -11248,6 +11250,7 @@ test "Terminal: fullReset with a non-empty pen" {
|
||||
}
|
||||
|
||||
try testing.expectEqual(@as(style.Id, 0), t.screens.active.cursor.style_id);
|
||||
try testing.expectEqual(.output, t.screens.active.cursor.semantic_content);
|
||||
}
|
||||
|
||||
test "Terminal: fullReset hyperlink" {
|
||||
|
||||
Reference in New Issue
Block a user