Keep selection in SwitchToHelixNormalMode (#41583)

Closes #41125

Release Notes:

- Fixed `SwitchToHelixNormalMode` to keep selection
- Added default keybinds for `SwitchToHelixNormalMode` when in Helix
mode
This commit is contained in:
Andrew Farkas
2025-10-31 01:53:46 +00:00
committed by GitHub
parent c2537fad43
commit eab06eb1d9
16 changed files with 182 additions and 74 deletions
+6 -2
View File
@@ -66,12 +66,16 @@ impl Display for Mode {
}
impl Mode {
pub fn is_visual(&self) -> bool {
pub fn is_visual(self) -> bool {
match self {
Self::Visual | Self::VisualLine | Self::VisualBlock | Self::HelixSelect => true,
Self::Normal | Self::Insert | Self::Replace | Self::HelixNormal => false,
}
}
pub fn is_helix(self) -> bool {
matches!(self, Mode::HelixNormal | Mode::HelixSelect)
}
}
impl Default for Mode {
@@ -990,7 +994,7 @@ pub struct SearchState {
pub prior_selections: Vec<Range<Anchor>>,
pub prior_operator: Option<Operator>,
pub prior_mode: Mode,
pub helix_select: bool,
pub is_helix_regex_search: bool,
}
impl Operator {