diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-01-01 05:19:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-01 05:19:03 +0000 |
commit | a1e2d6a5573d967aaceeadaefa17b6a00a2e4ca4 (patch) | |
tree | 5bdda93b515ad95a57487b266b021507bbc6b049 /alacritty/src/renderer/mod.rs | |
parent | 8ed72cc065255007a7f0687e3b8a540e8c6202c6 (diff) | |
download | r-alacritty-a1e2d6a5573d967aaceeadaefa17b6a00a2e4ca4.tar.gz r-alacritty-a1e2d6a5573d967aaceeadaefa17b6a00a2e4ca4.tar.bz2 r-alacritty-a1e2d6a5573d967aaceeadaefa17b6a00a2e4ca4.zip |
Add vi/search line indicator
This adds a new visual indicator which shows the position in history of
either the display offset during search, or the vi mode cursor.
To make it as unintrusive as possible, the overlay is hidden whenever
the vi mode cursor collides with its position.
Fixes #3984.
Diffstat (limited to 'alacritty/src/renderer/mod.rs')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 5edcbb4a..39e53b82 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -14,7 +14,7 @@ use fnv::FnvHasher; use log::{error, info}; use unicode_width::UnicodeWidthChar; -use alacritty_terminal::index::{Column, Line}; +use alacritty_terminal::index::Point; use alacritty_terminal::term::cell::Flags; use alacritty_terminal::term::color::Rgb; use alacritty_terminal::term::render::RenderableCell; @@ -820,25 +820,23 @@ impl<'a> RenderApi<'a> { pub fn render_string( &mut self, glyph_cache: &mut GlyphCache, - line: Line, - string: &str, + point: Point, fg: Rgb, - bg: Option<Rgb>, + bg: Rgb, + string: &str, ) { - let bg_alpha = bg.map(|_| 1.0).unwrap_or(0.0); - let cells = string .chars() .enumerate() .map(|(i, character)| RenderableCell { - line, - column: Column(i), + line: point.line, + column: point.col + i, character, zerowidth: None, flags: Flags::empty(), - bg_alpha, + bg_alpha: 1.0, fg, - bg: bg.unwrap_or(Rgb { r: 0, g: 0, b: 0 }), + bg, is_match: false, }) .collect::<Vec<_>>(); |