feat(view): add view.width.min/max replacing adaptive_size, allowing upper bound (#1915)

* feat: max_width for adaptive_size

* view grow calculates size correctly based on sign column visibility

* limit width to a minimum of 20

* adaptive_size -> min/max table

* harden view size calculations against bad user input

* style

* add back an extra column of padding to adaptive resizing

* back out: limit width to a minimum of 20

* revert unnecessary change

* backout: view grow calculates size correctly based on sign column visibility

* remove adaptive_size from help

* backout unnecessary change M.View.config

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
ramezgerges
2023-01-21 04:21:18 +00:00
committed by GitHub
parent 13adc94e8e
commit 96506fee49
4 changed files with 63 additions and 21 deletions

View File

@@ -30,6 +30,17 @@ local function refactored(opts)
-- 2023/01/08
utils.move_missing_val(opts, "trash", "require_confirm", opts, "ui.confirm", "trash", true)
-- 2023/01/15
if opts.view and opts.view.adaptive_size ~= nil then
if opts.view.adaptive_size and type(opts.view.width) ~= "table" then
local width = opts.view.width
opts.view.width = {
min = width,
}
end
opts.view.adaptive_size = nil
end
end
local function removed(opts)