From 0d060d5d801e3abb55035269138d819d38fc175b Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 20 Apr 2019 22:47:05 +0000 Subject: Fix cursor colors This fixes a recent regression in cfc20d4f34dca535654cc32df18e785296af4cc5 which broke cursor colors when specified in the `colors.cursor` field in the config. It also removes a lot of unneeded code from the font crate related to the cursor rendering. This fixes #2338. --- src/term/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/term/mod.rs') diff --git a/src/term/mod.rs b/src/term/mod.rs index 1f8850aa..5f69fb6c 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -385,6 +385,10 @@ impl<'a> Iterator for RenderableCellsIter<'a> { renderable_cell.inner = RenderableCellContent::Raw(cursor_cell); + if let Some(color) = self.config.cursor_cursor_color() { + renderable_cell.fg = color; + } + return Some(renderable_cell); } else { let mut cell = @@ -392,6 +396,10 @@ impl<'a> Iterator for RenderableCellsIter<'a> { if self.cursor_style == CursorStyle::Block { std::mem::swap(&mut cell.bg, &mut cell.fg); + + if let Some(color) = self.config.cursor_text_color() { + cell.fg = color; + } } return Some(cell); -- cgit