mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: render cursor behind colored emoji
This commit is contained in:
@ -1115,9 +1115,13 @@ fn rebuildCells(
|
|||||||
// the cell with the cursor.
|
// the cell with the cursor.
|
||||||
const start_i: usize = self.cells.items.len;
|
const start_i: usize = self.cells.items.len;
|
||||||
defer if (cursor_row) {
|
defer if (cursor_row) {
|
||||||
|
// If we're on a wide spacer tail, then we want to look for
|
||||||
|
// the previous cell.
|
||||||
|
const screen_cell = row.getCell(screen.cursor.x);
|
||||||
|
const x = screen.cursor.x - @intFromBool(screen_cell.attrs.wide_spacer_tail);
|
||||||
for (self.cells.items[start_i..]) |cell| {
|
for (self.cells.items[start_i..]) |cell| {
|
||||||
if (cell.grid_pos[0] == @as(f32, @floatFromInt(screen.cursor.x)) and
|
if (cell.grid_pos[0] == @as(f32, @floatFromInt(x)) and
|
||||||
cell.mode == .fg)
|
(cell.mode == .fg or cell.mode == .fg_color))
|
||||||
{
|
{
|
||||||
cursor_cell = cell;
|
cursor_cell = cell;
|
||||||
break;
|
break;
|
||||||
@ -1201,10 +1205,13 @@ fn rebuildCells(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cursor_cell) |*cell| {
|
if (cursor_cell) |*cell| {
|
||||||
cell.color = if (self.config.cursor_text) |txt|
|
if (cell.mode == .fg) {
|
||||||
.{ txt.r, txt.g, txt.b, 255 }
|
cell.color = if (self.config.cursor_text) |txt|
|
||||||
else
|
.{ txt.r, txt.g, txt.b, 255 }
|
||||||
.{ 0, 0, 0, 255 };
|
else
|
||||||
|
.{ 0, 0, 0, 255 };
|
||||||
|
}
|
||||||
|
|
||||||
self.cells.appendAssumeCapacity(cell.*);
|
self.cells.appendAssumeCapacity(cell.*);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -751,9 +751,13 @@ pub fn rebuildCells(
|
|||||||
// the cell with the cursor.
|
// the cell with the cursor.
|
||||||
const start_i: usize = self.cells.items.len;
|
const start_i: usize = self.cells.items.len;
|
||||||
defer if (cursor_row) {
|
defer if (cursor_row) {
|
||||||
|
// If we're on a wide spacer tail, then we want to look for
|
||||||
|
// the previous cell.
|
||||||
|
const screen_cell = row.getCell(screen.cursor.x);
|
||||||
|
const x = screen.cursor.x - @intFromBool(screen_cell.attrs.wide_spacer_tail);
|
||||||
for (self.cells.items[start_i..]) |cell| {
|
for (self.cells.items[start_i..]) |cell| {
|
||||||
if (cell.grid_col == screen.cursor.x and
|
if (cell.grid_col == x and
|
||||||
cell.mode == .fg)
|
(cell.mode == .fg or cell.mode == .fg_color))
|
||||||
{
|
{
|
||||||
cursor_cell = cell;
|
cursor_cell = cell;
|
||||||
break;
|
break;
|
||||||
@ -824,16 +828,18 @@ pub fn rebuildCells(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cursor_cell) |*cell| {
|
if (cursor_cell) |*cell| {
|
||||||
if (self.config.cursor_text) |txt| {
|
if (cell.mode == .fg) {
|
||||||
cell.fg_r = txt.r;
|
if (self.config.cursor_text) |txt| {
|
||||||
cell.fg_g = txt.g;
|
cell.fg_r = txt.r;
|
||||||
cell.fg_b = txt.b;
|
cell.fg_g = txt.g;
|
||||||
cell.fg_a = 255;
|
cell.fg_b = txt.b;
|
||||||
} else {
|
cell.fg_a = 255;
|
||||||
cell.fg_r = 0;
|
} else {
|
||||||
cell.fg_g = 0;
|
cell.fg_r = 0;
|
||||||
cell.fg_b = 0;
|
cell.fg_g = 0;
|
||||||
cell.fg_a = 255;
|
cell.fg_b = 0;
|
||||||
|
cell.fg_a = 255;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.cells.appendAssumeCapacity(cell.*);
|
self.cells.appendAssumeCapacity(cell.*);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user