From d547f4571453368366f04528a35ab2a675394e97 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 29 Apr 2021 16:06:43 -0700 Subject: [PATCH] avoid vanishing cursor when wrapped line is initially 0-width refs #740 --- wezterm-gui/src/termwindow/render.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wezterm-gui/src/termwindow/render.rs b/wezterm-gui/src/termwindow/render.rs index ca44147aa..eced0b0ee 100644 --- a/wezterm-gui/src/termwindow/render.rs +++ b/wezterm-gui/src/termwindow/render.rs @@ -1052,11 +1052,10 @@ impl super::TermWindow { } } - if params.stable_line_idx == Some(params.cursor.y) && params.cursor.x > last_cell_idx { - // Even though we don't have a cell for these, they still - // hold the cursor or the selection so we need to compute - // the colors in the usual way. - + if params.stable_line_idx == Some(params.cursor.y) + && ((params.cursor.x > last_cell_idx) || cell_clusters.is_empty()) + { + // Compute the cursor fg/bg let ComputeCellFgBgResult { fg_color: glyph_color, bg_color,