Closed alex-popov-tech closed 2 years ago
That would break the before_mount
hook.
I think it would be better to create a function to reset.
M.reset = function()
M.setup(state.user_opts)
end
And then make an autocommand.
vim.cmd([[
augroup fineline_commands
autocmd!
autocmd VimResized * lua require('fine-cmdline').reset()
augroup END
]])
oh yes, for before_mount
i should move input initialization a bit to the top....
i've just tested your proposition, but it did not worked for me, did you tried that autocmd with tmux pane resizing & terminal window resizing?
I did.
And even before that I tested VimResized
(without my code), I used these commands to setup a variable and then increment.
:lua vim.g.times = 0
:autocmd VimResized * lua vim.g.times = vim.g.times + 1
After each test I used :lua print(vim.g.times)
.
Anyway, if we are going this route of making a new instance might as well just delete the if
at the beginning of open
.
Hello, thank you for plugin!
I found an issue, which is when you calling
setup
it remembersM.Input
object with all required calculations, and if screen size changed ( for me it was tmux splits ), popup config passed by user is not relevant anymore:https://user-images.githubusercontent.com/21224705/142933682-c10fc841-df27-4013-9ea9-066f3d8471e8.mp4
so I just moved initialization of
M.Input
toopen
call to do it every time before rendering...here is my config chunk: