Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add paragraph-based navigation to terminal's vi mode (#56038)

Aleksei Gusev7e4caf003cad
diff --git a/crates/terminal/src/alacritty.rs b/crates/terminal/src/alacritty.rs
index b37deb6ace8..99b6eadf2fd 100644
--- a/crates/terminal/src/alacritty.rs
+++ b/crates/terminal/src/alacritty.rs
@@ -355,6 +355,8 @@ impl ViMotion {
Self::WordRight => AlacViMotion::WordRight,
Self::WordRightEnd => AlacViMotion::WordRightEnd,
Self::Bracket => AlacViMotion::Bracket,
+ Self::ParagraphUp => AlacViMotion::ParagraphUp,
+ Self::ParagraphDown => AlacViMotion::ParagraphDown,
}
}
}
diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs
index a6d87ca983c..60c99255504 100644
--- a/crates/terminal/src/terminal.rs
+++ b/crates/terminal/src/terminal.rs
@@ -96,6 +96,8 @@ enum ViMotion {
WordRight,
WordRightEnd,
Bracket,
+ ParagraphUp,
+ ParagraphDown,
}
#[derive(Clone, Debug)]
@@ -1922,6 +1924,8 @@ impl Terminal {
"H" => Some(ViMotion::High),
"M" => Some(ViMotion::Middle),
"L" => Some(ViMotion::Low),
+ "{" => Some(ViMotion::ParagraphUp),
+ "}" => Some(ViMotion::ParagraphDown),
_ => None,
};