From c688adc7b514de92afdb9c3c27faeda95f8fa475 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 22 Apr 2021 20:08:58 +0000 Subject: Fix cursor expansion across wide chars This fixes a regression introduced in 0.7.0 where the block cursor would not expand across both cells anymore when on top of a wide char spacer cell. The logic to always move the cursor on the wide char instead of the spacer has been moved to the alacritty_terminal crate, making sure it is always performed before any processing in the UI. --- alacritty_terminal/src/term/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'alacritty_terminal') diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 199fd207..0e6fa07f 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1786,7 +1786,10 @@ impl RenderableCursor { fn new(term: &Term) -> Self { // Cursor position. let vi_mode = term.mode().contains(TermMode::VI); - let point = if vi_mode { term.vi_mode_cursor.point } else { term.grid.cursor.point }; + let mut point = if vi_mode { term.vi_mode_cursor.point } else { term.grid.cursor.point }; + if term.grid[point].flags.contains(Flags::WIDE_CHAR_SPACER) { + point.column -= 1; + } // Cursor shape. let shape = if !vi_mode && !term.mode().contains(TermMode::SHOW_CURSOR) { -- cgit v1.2.3-54-g00ecf