From 18435dc4c5da317f9977a6d1af6cbc4f36b507ff Mon Sep 17 00:00:00 2001 From: etienne-k <2804556+etienne-k@users.noreply.github.com> Date: Tue, 21 Jun 2022 18:04:30 +0200 Subject: [PATCH] refactor(statusline): ensure the match is exhaustive --- helix-term/src/ui/statusline.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index eeaf7ac4f..b5699ea72 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -163,12 +163,15 @@ impl StatusLine { context, format!( " {} ", - match context.doc.mode() { - Mode::Insert if visible => "INS", - Mode::Select if visible => "SEL", - Mode::Normal if visible => "NOR", + if visible { + match context.doc.mode() { + Mode::Insert => "INS", + Mode::Select => "SEL", + Mode::Normal => "NOR", + } + } else { // If not focused, explicitly leave an empty space instead of returning None. - _ => " ", + " " } ), None,