From 52f6fd90867881300aa64034dc2c698c3fda1f34 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 8 Oct 2021 23:00:53 -0600 Subject: Add configurable crosshairs to Alacritty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the user to put semitransparent rectangles around the current cursor line and column, รก la Vim's cursor line/column, but for the whole terminal. --- alacritty_terminal/src/config/mod.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'alacritty_terminal/src/config/mod.rs') diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index 382314bd..3d7f73a3 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -5,6 +5,7 @@ use std::path::PathBuf; use serde::Deserialize; use alacritty_config_derive::ConfigDeserialize; +use crate::term::color::{Rgb}; mod scrolling; @@ -66,12 +67,29 @@ pub struct Cursor { pub style: ConfigCursorStyle, pub vi_mode_style: Option, pub unfocused_hollow: bool, - pub cursor_crosshairs: bool, + pub cursor_crosshairs: CursorCrosshairs, thickness: Percentage, blink_interval: u64, } +#[derive(ConfigDeserialize, Copy, Clone, Debug, PartialEq)] +pub struct CursorCrosshairs { + pub enable: bool, + pub color: Rgb, + pub opacity: Percentage, +} + +impl Default for CursorCrosshairs { + fn default() -> Self { + Self { + enable: false, + color: Rgb { r: 0x80, g: 0x80, b: 0x80 }, + opacity: Percentage::new(0.1), + } + } +} + impl Default for Cursor { fn default() -> Self { Self { @@ -80,7 +98,7 @@ impl Default for Cursor { blink_interval: 750, style: Default::default(), vi_mode_style: Default::default(), - cursor_crosshairs: false, + cursor_crosshairs: Default::default(), } } } -- cgit