From 2c1a0baccfad821a2829e9474d97cdc1298cee0c Mon Sep 17 00:00:00 2001 From: sammyette Date: Mon, 10 Apr 2023 18:16:41 -0400 Subject: [PATCH] feat: add statusview item to show selections (#1445) --- data/core/statusview.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/data/core/statusview.lua b/data/core/statusview.lua index 9c4e33fa..35fff21b 100644 --- a/data/core/statusview.lua +++ b/data/core/statusview.lua @@ -241,6 +241,21 @@ function StatusView:register_docview_items() tooltip = "line : column" }) + self:add_item({ + predicate = predicate_docview, + name = "doc:selections", + alignment = StatusView.Item.LEFT, + get_item = function() + local dv = core.active_view + local nsel = #dv.doc.selections // 4 + if nsel > 1 then + return { style.text, nsel, " selections" } + end + + return {} + end + }) + self:add_item({ predicate = predicate_docview, name = "doc:indentation",