Update cosmic-text, status line for additional ViEditor modes

This commit is contained in:
Jeremy Soller 2023-11-08 15:42:46 -07:00
parent 02a093be0e
commit 12c8536d0c
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
2 changed files with 48 additions and 47 deletions

View file

@ -893,18 +893,23 @@ impl cosmic::Application for App {
Some(tab) => {
tab_column =
tab_column.push(text_box(&tab.editor, self.config.metrics()).padding(8));
let status = match tab.editor.lock().unwrap().mode() {
ViMode::Passthrough => {
//TODO: status line
String::new()
}
ViMode::Normal => {
//TODO: status line
String::new()
}
let status = match &tab.editor.lock().unwrap().parser().mode {
ViMode::Normal => String::new(),
ViMode::Insert => {
format!("-- INSERT --")
}
ViMode::Extra(extra) => {
format!("{}", extra)
}
ViMode::Replace => {
format!("-- REPLACE --")
}
ViMode::Visual => {
format!("-- VISUAL --")
}
ViMode::VisualLine => {
format!("-- VISUAL LINE --")
}
ViMode::Command { value } => {
format!(":{value}|")
}