mini.files - customize height of windows #1140
-
Hi, I am trying to modify the height of the windows in mini.files to all be the same height. It feels like this should be doable using vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesWindowUpdate",
callback = function(args)
local win_id = args.data.win_id
local config = vim.api.nvim_win_get_config(win_id)
config.height = 10
vim.api.nvim_win_set_config(win_id, config)
end,
}) This is the behavior currently. example_height.mp4As can be seen the event fires when opening the explorer, and when opening a file. Perhaps I am misunderstanding the way that the event is working? It is working as expected when settign stuff like border or winblend, is it that the plugin is setting the window height after the event has happened? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thanks for reporting this! Yeah, I think I'd also expect setting window height to work here. The quick test showed that the culprit is an intentional blocking of There is also a special treatment of window height that needs to be addressed for this autocommand to work. I'll take a look. |
Beta Was this translation helpful? Give feedback.
-
@adriankarlen, this now should be possible on latest |
Beta Was this translation helpful? Give feedback.
@adriankarlen, this now should be possible on latest
main
with this documented example. It not working previously was indeed the result of an intentional blocking ofMiniPickWindowUpdate
event from being triggered too frequently. As this is not the first issue that came out of this, it seems that triggering the event whenever window config changes in the better way to actually make it work as it was designed (to customize window config). There even is now a test for this particular setup, so there is less chance that it stops working.