diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-07-23 23:15:51 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-07-23 23:15:51 +0200 |
| commit | d75a835ca1cc8786fda83669b1d396af590f8a96 (patch) | |
| tree | a184805049806571feb4e2bcb22b51d349398743 /src/input_handler.cc | |
| parent | d1c005dd8c98fb809a2ec0bb5dad503a03a263f8 (diff) | |
| parent | 287a20c485bd662bb05faa061ed7c5e1c52f974e (diff) | |
Merge remote-tracking branch 'Delapouite/main_index'
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 7ad7aeed..74102279 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -299,7 +299,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")); |
