diff options
| author | Delapouite <delapouite@gmail.com> | 2017-07-12 08:39:24 +0200 |
|---|---|---|
| committer | Delapouite <delapouite@gmail.com> | 2017-07-12 19:08:13 +0200 |
| commit | 287a20c485bd662bb05faa061ed7c5e1c52f974e (patch) | |
| tree | 63f83a814af3ee246fb66297db6395651abaf8a0 /src/input_handler.cc | |
| parent | 74076ef9b7e43ee0ddb9a9304bec32dda86ec2f4 (diff) | |
Add main selection index in mode_info
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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")); |
