noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

"max_width" and "max_height" support percentage string

Open adoyle-h opened this issue 1 year ago • 4 comments

The size of view:

size = {
    max_height = '50%',
    max_width = '50%',
    width = 'auto',
    height = 'auto',
}

adoyle-h avatar Oct 31 '22 07:10 adoyle-h

would perhaps make more sense to use a float number

max397574 avatar Nov 07 '22 21:11 max397574

noice uses nui to show popups. The nui supports number or percentage string or table for size.

adoyle-h avatar Nov 09 '22 08:11 adoyle-h

@adoyle-h the max_width and max_height options are added by Noice. Will see to upstream those and make it so we can have percentages as well

folke avatar Nov 09 '22 08:11 folke

@folke Noice calculate the width. size.width = minmax(size.min_width, size.max_width, dim.width) https://github.com/folke/noice.nvim/blob/d0eea152566c1f7e15eb297959e4efbd1420a11c/lua/noice/util/nui.lua#L198-L201

adoyle-h avatar Nov 09 '22 08:11 adoyle-h