diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-07-09 21:45:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 21:45:22 +0000 |
commit | 46c0f352c40ecb68653421cb178a297acaf00c6d (patch) | |
tree | 3e1985f8237f7c8268703634f8c8ccb25f7823a5 /alacritty/src/renderer/mod.rs | |
parent | 9974bc8baa45fda0b4ba3db2ae615fb7f90f7029 (diff) | |
download | r-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.tar.gz r-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.tar.bz2 r-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.zip |
Add regex scrollback buffer search
This adds a new regex search which allows searching the entire
scrollback and jumping between matches using the vi mode.
All visible matches should be highlighted unless their lines are
excessively long. This should help with performance since highlighting
is done during render time.
Fixes #1017.
Diffstat (limited to 'alacritty/src/renderer/mod.rs')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index b2940a93..7dc037a1 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -298,7 +298,7 @@ impl GlyphCache { pub fn update_font_size<L: LoadGlyph>( &mut self, - font: config::Font, + font: &config::Font, dpr: f64, loader: &mut L, ) -> Result<(), font::Error> { @@ -307,7 +307,7 @@ impl GlyphCache { // Recompute font keys. let (regular, bold, italic, bold_italic) = - Self::compute_font_keys(&font, &mut self.rasterizer)?; + Self::compute_font_keys(font, &mut self.rasterizer)?; self.rasterizer.get_glyph(GlyphKey { font_key: regular, c: 'm', size: font.size })?; let metrics = self.rasterizer.metrics(regular, font.size)?; @@ -968,29 +968,29 @@ impl<'a, C> RenderApi<'a, C> { /// errors. pub fn render_string( &mut self, - string: &str, - line: Line, glyph_cache: &mut GlyphCache, - color: Option<Rgb>, + line: Line, + string: &str, + fg: Rgb, + bg: Option<Rgb>, ) { - let bg_alpha = color.map(|_| 1.0).unwrap_or(0.0); - let col = Column(0); + let bg_alpha = bg.map(|_| 1.0).unwrap_or(0.0); let cells = string .chars() .enumerate() .map(|(i, c)| RenderableCell { line, - column: col + i, + column: Column(i), inner: RenderableCellContent::Chars({ let mut chars = [' '; cell::MAX_ZEROWIDTH_CHARS + 1]; chars[0] = c; chars }), - bg: color.unwrap_or(Rgb { r: 0, g: 0, b: 0 }), - fg: Rgb { r: 0, g: 0, b: 0 }, flags: Flags::empty(), bg_alpha, + fg, + bg: bg.unwrap_or(Rgb { r: 0, g: 0, b: 0 }), }) .collect::<Vec<_>>(); |