diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-04-25 20:01:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 20:01:23 +0000 |
commit | 494348abe80f591dfdd68fd4987bafc59fcb32c1 (patch) | |
tree | 6045c1e4f1e846962d0fe4d2c925c14c4805a98d /src/term | |
parent | e964af8a5ea390d96667e80873060d33079134fd (diff) | |
download | alacritty-494348abe80f591dfdd68fd4987bafc59fcb32c1.tar.gz alacritty-494348abe80f591dfdd68fd4987bafc59fcb32c1.zip |
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.
Diffstat (limited to 'src/term')
-rw-r--r-- | src/term/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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; |