refactor(statusline): ensure the match is exhaustive

pull/2434/head
etienne-k 2022-06-21 18:04:30 +02:00
parent f3513a6526
commit 18435dc4c5
1 changed files with 8 additions and 5 deletions

View File

@ -163,12 +163,15 @@ impl StatusLine {
context, context,
format!( format!(
" {} ", " {} ",
match context.doc.mode() { if visible {
Mode::Insert if visible => "INS", match context.doc.mode() {
Mode::Select if visible => "SEL", Mode::Insert => "INS",
Mode::Normal if visible => "NOR", Mode::Select => "SEL",
Mode::Normal => "NOR",
}
} else {
// If not focused, explicitly leave an empty space instead of returning None. // If not focused, explicitly leave an empty space instead of returning None.
_ => " ", " "
} }
), ),
None, None,