support for auto resize in x and y axis
Bunch of AI code, but seems to work. maybe config 'autoboth' should be exposed slightly different manner, but for ease of implementation if enabled it will auto resize windows in both x and y axis. Default settings for autoboth:
require("windows").setup {
autowidth = {
enable = false,
winwidth = 5,
filetype = {
help = 2,
},
},
autoheight = {
enable = false,
winheight = 5,
filetype = {
help = 1,
},
},
autoboth = { -- will use settings from autowidth sections (for width param) and autoheight section (for height controls)
enable = true,
},
end
https://github.com/user-attachments/assets/68f01dd8-edcf-4bee-ae5b-bf7bcb6efcfd
I am currently evaluating your PR in my setup and like it a lot.
I encountered a bug where windows.nvim/lua/windows/lib/api.lua:172: function 'set_height' gets called with non-integer values. I was able to workaround this quickly by just flooring it there but that is probably not the right way of tackling this.
Also i am a bit confused by the presence of the autoboth option, my assumption in terms of api would be that if autowidth and autoheight are enabled, autoboth would not be needed?!
I did not get any errors with set height, but it is based on 'original' set_width - where no round function is used. So I can only assume the value should be rounded before set_height is called... (btw. I get set_height on different line - so maybe you did not update the code?). About auto-both, yes I should made it - use : width and/or height option , rather than both. But it was easier to code/generate as separate function. I did not want to change original code too much, so mostly new code was added with new modules/files. Original files were mostly kept as is - with only few height functions implemented (based on width counterparts) .
So.. is this gonna get merged?
So.. is this gonna get merged?
The window dew was not active since war on ukraine started...
I hope he's okay Why don't you make a fork that we can use, at least until he's active again?