From 4a10220db85f35cc1b0538b97ff393ce24e58b5c Mon Sep 17 00:00:00 2001 From: Chris Webb Date: Sat, 11 Dec 2021 12:11:08 +0000 Subject: [PATCH 2/2] Fix mode line inconsistency between normal and insert modes In normal mode, the mode line contains "1 sel" or "n sels (k)" when n > 1, whereas in insert mode, it contains "n sels (k)" even for n == 1. Change the contents in insert mode to match normal mode. --- src/input_handler.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/input_handler.cc b/src/input_handler.cc index ef25826b..8adbbcee 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -1443,8 +1443,9 @@ public: auto main_index = context().selections().main_index(); return {AtomList{ { "insert", context().faces()["StatusLineMode"] }, { " ", context().faces()["StatusLine"] }, - { format( "{} sels ({})", num_sel, main_index + 1), - context().faces()["StatusLineInfo"] } }}; + { num_sel == 1 ? format("{} sel", num_sel) + : format("{} sels ({})", num_sel, main_index + 1), + context().faces()["StatusLineInfo"] } }}; } KeymapMode keymap_mode() const override { return KeymapMode::Insert; }