aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2017-12-07 21:52:50 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-12-24 09:46:54 -0800
commitd82c4f02b69a8e16057a42de470c5bea114ffda6 (patch)
tree64f7f4bbd14634410cfcabae826a4f63b25199ba /src/term/mod.rs
parent9f708146d989f601bd4cc5b253cd58db02ce41d3 (diff)
downloadalacritty-d82c4f02b69a8e16057a42de470c5bea114ffda6.tar.gz
alacritty-d82c4f02b69a8e16057a42de470c5bea114ffda6.zip
Add custom beam cursor
In issue jwilm/asacritty#31 a few people complained about Beam cursor being weird with their fonts, so to make all cursors uniform in alacritty, a custom cursor has been added for the Beam too. The beam cursor's height is always the full height of the monospace font glyph bounding box. The width depends on the font size. It is calculated using the width of the cell and dividing it by two. The block is always aligned at the far-left of the cell. The implementation is identical to the one of the underline cursor, but it has been refactored so the glyphs are created in `lib.rs`, which can be used by darwin/macos to implement these features too. A small bug in the underline cursor has also been fixed, until now the width was just using the width of the unicode character. Now it should be using the full width of the monospace glyph bounding box with every font. Here are some screenshots for the Beam cursor: ![Small](https://u.teknik.io/v1QH3.png) ![Normal](https://u.teknik.io/RTlp2.png) ![Big](https://u.teknik.io/DLu2M.png) ![Huge](https://u.teknik.io/pSAFX.png)
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r--src/term/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 2e1365fb..86115171 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -181,7 +181,7 @@ impl<'a> RenderableCellsIter<'a> {
});
let cursor_color = self.text_cursor_color(&cursor_cell);
- cursor_cell.c = '▎';
+ cursor_cell.c = font::BEAM_CURSOR_CHAR;
cursor_cell.fg = cursor_color;
self.cursor_cells.push_back(Indexed {
line: self.cursor.line,