diff options
-rw-r--r-- | alacritty/src/display/content.rs | 8 | ||||
-rw-r--r-- | alacritty/src/display/mod.rs | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index 6532f236..a25ddce8 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -19,6 +19,7 @@ use crate::config::ui_config::UiConfig; use crate::display::color::{List, DIM_FACTOR}; use crate::display::hint::HintState; use crate::display::Display; +use crate::event::SearchState; /// Minimum contrast between a fixed cursor color and the cell's background. pub const MIN_CURSOR_CONTRAST: f64 = 1.5; @@ -44,16 +45,17 @@ impl<'a> RenderableContent<'a> { config: &'a Config<UiConfig>, display: &'a mut Display, term: &'a Term<T>, - search_dfas: Option<&RegexSearch>, + search_state: &SearchState, ) -> Self { - let search = search_dfas.map(|dfas| Regex::new(&term, dfas)).unwrap_or_default(); + let search = search_state.dfas().map(|dfas| Regex::new(&term, dfas)).unwrap_or_default(); let terminal_content = term.renderable_content(); // Copy the cursor and override its shape if necessary. let mut terminal_cursor = terminal_content.cursor; + if terminal_cursor.shape == CursorShape::Hidden || display.cursor_hidden - || search_dfas.is_some() + || search_state.regex().is_some() { terminal_cursor.shape = CursorShape::Hidden; } else if !term.is_focused && config.cursor.unfocused_hollow { diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index d44013c4..cbf2930a 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -484,8 +484,7 @@ impl Display { .and_then(|focused_match| terminal.grid().clamp_buffer_range_to_visible(focused_match)); // Collect renderable content before the terminal is dropped. - let search_dfas = search_state.dfas(); - let mut content = RenderableContent::new(config, self, &terminal, search_dfas); + let mut content = RenderableContent::new(config, self, &terminal, search_state); let mut grid_cells = Vec::new(); while let Some(cell) = content.next() { grid_cells.push(cell); |