vim: Combine match arms in Mode::is_visual (#25675)

This PR refactors the `Mode::is_visual` implementation to combine some
of the `match` arms.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-26 14:45:04 -05:00 committed by GitHub
parent eeac1a9287
commit c53020ceaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,9 +45,8 @@ impl Display for Mode {
impl Mode {
pub fn is_visual(&self) -> bool {
match self {
Mode::Normal | Mode::Insert | Mode::Replace => false,
Mode::Visual | Mode::VisualLine | Mode::VisualBlock => true,
Mode::HelixNormal => false,
Self::Visual | Self::VisualLine | Self::VisualBlock => true,
Self::Normal | Self::Insert | Self::Replace | Self::HelixNormal => false,
}
}
}