diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-04-22 00:20:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-22 00:20:43 +0000 |
commit | 4b3e7da0fcef7b876c8fdd015d321d06e5f64e63 (patch) | |
tree | aa7578e501d9cc349eb56c4fd35f53640406c73a /src/term/mod.rs | |
parent | d3cfda03715c6a644048995afdffdb085984585a (diff) | |
download | alacritty-4b3e7da0fcef7b876c8fdd015d321d06e5f64e63.tar.gz alacritty-4b3e7da0fcef7b876c8fdd015d321d06e5f64e63.zip |
Fix hidden cursor inverting cell colors
Since the block cursor inverts the background and foreground colors of a
cell, the hidden cursor has done the same thing without rendering a
cursor since it was using the block cursor shape.
A new `Hidden` cursor style has been introduced for explicitly handling
the invisible cursor differently.
This fixes #2342.
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 5f69fb6c..0e95423d 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -175,7 +175,7 @@ impl<'a> RenderableCellsIter<'a> { term: &'b Term, config: &'b Config, selection: Option<Locations>, - cursor_style: CursorStyle, + mut cursor_style: CursorStyle, metrics: font::Metrics, ) -> RenderableCellsIter<'b> { let grid = &term.grid; @@ -236,6 +236,8 @@ impl<'a> RenderableCellsIter<'a> { && (cursor.col + 1) < grid.num_cols(); Some(cursor::get_cursor_glyph(cursor_style, metrics, offset_x, offset_y, is_wide)) } else { + // Use hidden cursor so text will not get inverted + cursor_style = CursorStyle::Hidden; None }; |