Helix Select Mode (#37748)
Please credit @eliaperantoni, for the original PR (#34136). Merge after (#34060) to avoid conflicts. Closes https://github.com/zed-industries/zed/issues/33838 Closes https://github.com/zed-industries/zed/issues/33906 Release Notes: - Helix will no longer sometimes fall out into "normal" mode, will remain in "helix normal" (example: vv) - Added dedicated "helix select" mode that can be targeted by keybindings Known issues: - [ ] Helix motion, especially surround-add will not properly work in visual mode, as it won't call `helix_move_cursor`. It is possible however to respect self.mode in change_selection now. - [ ] Some operations, such as `Ctrl+A` (increment) or `>` (indent) will collapse selection also. I haven't found a way to avoid it. --------- Co-authored-by: fantacell <ghub@giggo.de> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
co-authored by
fantacell
Conrad Irwin
parent
a577128163
commit
cba9ff55c7
@@ -46,6 +46,7 @@ pub enum Mode {
|
||||
VisualLine,
|
||||
VisualBlock,
|
||||
HelixNormal,
|
||||
HelixSelect,
|
||||
}
|
||||
|
||||
impl Display for Mode {
|
||||
@@ -58,6 +59,7 @@ impl Display for Mode {
|
||||
Mode::VisualLine => write!(f, "VISUAL LINE"),
|
||||
Mode::VisualBlock => write!(f, "VISUAL BLOCK"),
|
||||
Mode::HelixNormal => write!(f, "HELIX NORMAL"),
|
||||
Mode::HelixSelect => write!(f, "HELIX SELECT"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +67,7 @@ impl Display for Mode {
|
||||
impl Mode {
|
||||
pub fn is_visual(&self) -> bool {
|
||||
match self {
|
||||
Self::Visual | Self::VisualLine | Self::VisualBlock => true,
|
||||
Self::Visual | Self::VisualLine | Self::VisualBlock | Self::HelixSelect => true,
|
||||
Self::Normal | Self::Insert | Self::Replace | Self::HelixNormal => false,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user