feat: add statusview item to show selections (#1445)

This commit is contained in:
sammyette 2023-04-10 18:16:41 -04:00 committed by GitHub
parent 1f1b7fc1ef
commit 2c1a0baccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -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",