feat: add statusview item to show selections (#1445)
This commit is contained in:
parent
1f1b7fc1ef
commit
2c1a0baccf
|
@ -241,6 +241,21 @@ function StatusView:register_docview_items()
|
||||||
tooltip = "line : column"
|
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({
|
self:add_item({
|
||||||
predicate = predicate_docview,
|
predicate = predicate_docview,
|
||||||
name = "doc:indentation",
|
name = "doc:indentation",
|
||||||
|
|
Loading…
Reference in New Issue