From 6f43c01b7664dd81d21d3379bf960327221f7599 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 18 Jun 2024 14:59:49 -0700 Subject: [PATCH] renderer/opengl: invert cursor cell text when glyph is constrained Fixes #1867 --- src/renderer/OpenGL.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index 8389dbae6..8c48d67d9 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -1006,7 +1006,9 @@ pub fn rebuildCells( const x = screen.cursor.x - @intFromBool(screen_cell.wide == .spacer_tail); for (self.cells.items[start_i..]) |cell| { if (cell.grid_col == x and - (cell.mode == .fg or cell.mode == .fg_color)) + (cell.mode == .fg or + cell.mode == .fg_color or + cell.mode == .fg_constrained)) { cursor_cell = cell; break; @@ -1113,7 +1115,7 @@ pub fn rebuildCells( _ = try self.addCursor(screen, cursor_style); if (cursor_cell) |*cell| { - if (cell.mode == .fg) { + if (cell.mode == .fg or cell.mode == .fg_constrained) { if (self.config.cursor_text) |txt| { cell.r = txt.r; cell.g = txt.g;