diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-03-06 03:18:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-06 03:18:48 +0000 |
commit | d5dd009a6d313626aec6f69db397e78734653a5f (patch) | |
tree | a046f2a2b798f25496041af94f50a979ccf69f11 /alacritty/src/display/content.rs | |
parent | a954e076ca0b1ee9c1f272c2b119c67df3935fd4 (diff) | |
download | r-alacritty-d5dd009a6d313626aec6f69db397e78734653a5f.tar.gz r-alacritty-d5dd009a6d313626aec6f69db397e78734653a5f.tar.bz2 r-alacritty-d5dd009a6d313626aec6f69db397e78734653a5f.zip |
Fix vi mode search
This fixes a regression introduced in a954e07 which caused the vi mode
cursor to be invisible after starting a search.
This was caused by a discrepancy between the search DFA and search
active state, since a search is not active after it has been confirmed
but the DFAs are still present for highlighting.
Diffstat (limited to 'alacritty/src/display/content.rs')
-rw-r--r-- | alacritty/src/display/content.rs | 8 |
1 files changed, 5 insertions, 3 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 { |