vim: Fix some problems with visual mode testing (#8461)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-02-26 20:15:27 -07:00 committed by GitHub
parent 079c31fcac
commit 8cf36ae603
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 43 additions and 25 deletions

View file

@ -1,4 +1,4 @@
use std::{ops::Range, sync::Arc};
use std::{fmt::Display, ops::Range, sync::Arc};
use collections::HashMap;
use gpui::{Action, KeyContext};
@ -17,6 +17,18 @@ pub enum Mode {
VisualBlock,
}
impl Display for Mode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Mode::Normal => write!(f, "NORMAL"),
Mode::Insert => write!(f, "INSERT"),
Mode::Visual => write!(f, "VISUAL"),
Mode::VisualLine => write!(f, "VISUAL LINE"),
Mode::VisualBlock => write!(f, "VISUAL BLOCK"),
}
}
}
impl Mode {
pub fn is_visual(&self) -> bool {
match self {