From 494348abe80f591dfdd68fd4987bafc59fcb32c1 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 25 Apr 2019 20:01:23 +0000 Subject: Fix cursor disappearing The cfc20d4f34dca535654cc32df18e785296af4cc5 commit introduced a regression which would cause the cursor to disappear after the glyph cache has been filled. Since the cursor was not cached on the glyph cache, the cursor would quickly fill up the OpenGL texture with lots of cursor textures and then things would break after the atlas was filled completely. This adds a separate cursor cache which is keyed by the cursor style that will persist the texture without flooding the atlas. This fixes #2355. --- src/term/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/term/mod.rs') diff --git a/src/term/mod.rs b/src/term/mod.rs index 2096e7a1..a9a3841f 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -259,7 +259,7 @@ impl<'a> RenderableCellsIter<'a> { #[derive(Clone, Debug)] pub enum RenderableCellContent { Chars([char; cell::MAX_ZEROWIDTH_CHARS + 1]), - Raw(RasterizedGlyph), + Cursor((CursorStyle, RasterizedGlyph)), } #[derive(Clone, Debug)] @@ -388,7 +388,8 @@ impl<'a> Iterator for RenderableCellsIter<'a> { let mut renderable_cell = RenderableCell::new(self.config, self.colors, cell, false); - renderable_cell.inner = RenderableCellContent::Raw(cursor_cell); + renderable_cell.inner = + RenderableCellContent::Cursor((self.cursor_style, cursor_cell)); if let Some(color) = self.config.cursor_cursor_color() { renderable_cell.fg = color; -- cgit v1.2.3-54-g00ecf