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.

vim: Display invisibles in mode indicator (#35760)

AidanVe1d31cfcc336
diff --git a/crates/vim/src/state.rs b/crates/vim/src/state.rs
index c4be0348717..423859dadca 100644
--- a/crates/vim/src/state.rs
+++ b/crates/vim/src/state.rs
@@ -1028,13 +1028,21 @@ impl Operator {
}
pub fn status(&self) -> String {
+ fn make_visible(c: &str) -> &str {
+ match c {
+ "\n" => "enter",
+ "\t" => "tab",
+ " " => "space",
+ c => c,
+ }
+ }
match self {
Operator::Digraph {
first_char: Some(first_char),
- } => format!("^K{first_char}"),
+ } => format!("^K{}", make_visible(&first_char.to_string())),
Operator::Literal {
prefix: Some(prefix),
- } => format!("^V{prefix}"),
+ } => format!("^V{}", make_visible(&prefix)),
Operator::AutoIndent => "=".to_string(),
Operator::ShellCommand => "=".to_string(),
_ => self.id().to_string(),