From 287a20c485bd662bb05faa061ed7c5e1c52f974e Mon Sep 17 00:00:00 2001 From: Delapouite Date: Wed, 12 Jul 2017 08:39:24 +0200 Subject: [PATCH] Add main selection index in mode_info --- src/input_handler.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/input_handler.cc b/src/input_handler.cc index 666a36cf..de0ca31b 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -298,7 +298,14 @@ public: DisplayLine mode_line() const override { - AtomList atoms = { { to_string(context().selections().size()) + " sel", get_face("StatusLineInfo") } }; + AtomList atoms; + auto num_sel = context().selections().size(); + auto main_index = context().selections().main_index(); + if (num_sel == 1) + atoms.emplace_back(format("{} sel", num_sel), get_face("StatusLineInfo")); + else + atoms.emplace_back(format("{} sels ({})", num_sel, main_index + 1), get_face("StatusLineInfo")); + if (m_params.count != 0) { atoms.emplace_back(" param=", get_face("StatusLineInfo"));