`VimResized` should be added by default in the `trigget_events` for the `register`
Closed this issue · 5 comments
Hello :) First off, I really love this plugin! not only because of how useful it is, but also because it's all I ever needed to close this issue in a repo of mine.
Now, why should VimResized
be added by default? Here is an example:
Without VimResized
without_resized.mp4
With VimResized
with_resized.mp4
Explanation
Basically what's going on here is that I have tmux
open, with 3 splits, and the one in the left is being focused at the beginning and then unfocused. Without that event, after one moves the cursor (in my case), the text "shifts" (I have wrap
set), however with VimResized
it does not happens, for obvious reasons.
Notice that this isn't like a tmux
-only thing, you can test this by simply using any other terminal multiplexer or by resizing the terminal.
Perhaps it'd be good it add it by default?
Hi Pocco81, thank you for the kind words! Glad that the plugin has helped you out.
Now I am not too sure I have reproduced correctly. But I have three tmux windows opened, with wrap
turned on, and I am toggling the tmux zoom on my left buffer and everything seems to work correctly, I was not able to reproduce the error.
My setup is as followed
require("bufresize").setup({
register = {
keys = {
{ "n", "<leader>w<", "30<C-w><", NS },
{ "n", "<leader>w>", "30<C-w>>", NS },
{ "n", "<leader>w+", "10<C-w>+", NS },
{ "n", "<leader>w-", "10<C-w>-", NS },
{ "n", "<leader>w_", "<C-w>_", NS },
{ "n", "<leader>w=", "<C-w>=", NS },
{ "n", "<leader>w|", "<C-w>|", NS },
{ "n", "<leader>wo", "<C-w>|<C-w>_", NS },
{ "", "<LeftRelease>", "<LeftRelease>", NS },
{ "i", "<LeftRelease>", "<LeftRelease><C-o>", NS },
},
},
})
I suspect there is actually a Vim error, can you check :messages
after resizing and see if there are any errors?
Screen.Recording.2021-09-26.at.10.23.16.PM.mov
I don't know why adding VimResized
to register
help you solve the problem, because if you have VimResized
in resize
, then the resize actually call register
to record the state after the applying the proportional resize to the windows.
Huh that's weird. Can I see your bufresize conf? Mine is in the dev
branch on my dots repo.
For sure, it is here.
I have tried the config on your dev branch with the same lazy loading event, commit version and setup, but still cannot reproduce the error.
Now I have encountered needing to press one more key for the wrapping to happen, but then later I found out that actually means there is an error occurred in the command window, it is just not shown when resized, you would have to manually check it through :messages
. Not sure if this is the same case as yours.
I am going to close this for now. But feel free to open it again if you have more problems.