summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2020-02-14 01:22:02 +0300
committerGitHub <noreply@github.com>2020-02-13 22:22:02 +0000
commit696fc792e833f8d37b184c63ad004651b8bba5ea (patch)
treea1ef99db7304246e536d72e007a5591327ee894b
parent7ecf93ec7061869713ebaa07384ad7a935c4a4d5 (diff)
downloadalacritty-696fc792e833f8d37b184c63ad004651b8bba5ea.tar.gz
alacritty-696fc792e833f8d37b184c63ad004651b8bba5ea.zip
Increase Beam, Underline and Box cursors' line width
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/cursor.rs4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 43af69de..9b4a3ec1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Line selection will now expand across wrapped lines
- The default value for `draw_bold_text_with_bright_colors` is now `false`
- Mirror OSC query terminators instead of always using BEL
+- Increased Beam, Underline, and Hollow Block cursors' line widths
### Fixed
diff --git a/alacritty/src/cursor.rs b/alacritty/src/cursor.rs
index a3e6a2ca..734c6817 100644
--- a/alacritty/src/cursor.rs
+++ b/alacritty/src/cursor.rs
@@ -21,7 +21,7 @@ use alacritty_terminal::ansi::CursorStyle;
use font::{BitmapBuffer, Metrics, RasterizedGlyph};
/// Width/Height of the cursor relative to the font width
-pub const CURSOR_WIDTH_PERCENTAGE: i32 = 15;
+pub const CURSOR_WIDTH_PERCENTAGE: f64 = 0.15;
pub fn get_cursor_glyph(
cursor: CursorStyle,
@@ -33,7 +33,7 @@ pub fn get_cursor_glyph(
// Calculate the cell metrics
let height = metrics.line_height as i32 + i32::from(offset_y);
let mut width = metrics.average_advance as i32 + i32::from(offset_x);
- let line_width = cmp::max(width * CURSOR_WIDTH_PERCENTAGE / 100, 1);
+ let line_width = cmp::max((width as f64 * CURSOR_WIDTH_PERCENTAGE).round() as i32, 1);
// Double the cursor width if it's above a double-width glyph
if is_wide {