diff options
author | Christian Duerr <contact@christianduerr.com> | 2017-12-06 22:24:47 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-24 09:46:54 -0800 |
commit | bf72b5a326c2c06541fd0564417a4ad52a9938bc (patch) | |
tree | 269ef6325214f9a45c666537abcee97417e2780d /src | |
parent | 958a32767ff9e06dc569eb612da889bfa06970be (diff) | |
download | alacritty-bf72b5a326c2c06541fd0564417a4ad52a9938bc.tar.gz alacritty-bf72b5a326c2c06541fd0564417a4ad52a9938bc.zip |
Add custom underline cursor
As mentioned in jwilm/alacritty#931, it can be troublesome if a font has
an underline symbol outside of the glyph's bounding box. This can lead
to the underline disappearing at the bottom of the terminal.
As a solution a symbol from the private use area was used as the
character code for the underline symbol. Whenever this symbol is
encountered, instead of rendering it, a custom block is rendered.
In this implementation the block has the full character as width and
sits flush with the bottom of the glyph's bounding box. The height is
half the distance between the baseline and the bottom of the bounding
box.
Diffstat (limited to 'src')
-rw-r--r-- | src/term/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 18858da5..892a96bb 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -207,7 +207,8 @@ impl<'a> RenderableCellsIter<'a> { }); let cursor_color = self.text_cursor_color(&cursor_cell); - cursor_cell.c = '▁'; + // This is part of the private use area and shouldn't be used by any font + cursor_cell.c = ''; cursor_cell.fg = cursor_color; self.cursor_cells.push_back(Indexed { line: self.cursor.line, |