-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mini.animate] animation interferes with vim-visual-multi #448
Comments
Thanks for the issue! I don't use 'mg979/vim-visual-multi' so didn't notice this myself. I tried steps and did in fact reproduce this. Your explanation for small jitter does sound plausible. The reason you don't see it with So in order to make it work, all actions from 'vim-visual-multi' should not trigger
_G.remap_with_ignore_winscrolled = function(mode, lhs)
local rhs = vim.fn.maparg(lhs, mode)
local new_rhs = table.concat({
'<cmd>let g:eventignore = &eventignore | set eventignore=WinScrolled<cr>',
rhs,
'<cmd>let &eventignore = g:eventignore<cr>',
})
vim.keymap.set(mode, lhs, new_rhs)
end Then call I think I'll ask you if this snippet fixes your case (at least for a one time call). If yes, then I'll close this issue as there is nothing much to be done on 'mini.animate' side here. |
Thank you @echasnovski for the answer. I'm a bit confused as to where I need to put the function and call it. I'm lazy loading plugins, and this is my url = 'https://github.com/mg979/vim-visual-multi',
name = 'vim-visual-multi',
event = { 'VeryLazy' },
keys = {
-- ... my keys, ctrl+n in normal/visual etc.
},
init = function()
vim.g.VM_theme = 'iceblue'
vim.g.VM_set_statusline = 0
vim.g.VM_show_warnings = false
_G.remap_with_ignore_winscrolled = function(mode, lhs)
local rhs = vim.fn.maparg(lhs, mode)
local new_rhs = table.concat({
'<cmd>let g:eventignore = &eventignore | set eventignore=WinScrolled<cr>',
'<Plug>(VM-Find-Under)',
'<cmd>let &eventignore = g:eventignore<cr>',
})
vim.keymap.set(mode, lhs, new_rhs)
end
_G.remap_with_ignore_winscrolled('n', '<C-n>')
end, But, I still see the jitter/scroll once I do |
Before you press This function should be executed after 'vim-visual-multi' does its mappings. If you can't pin point the exact moment it happens, you may have luck to wrap custom wrapper in _G.remap_with_ignore_winscrolled = vim.schedule_wrap(function(mode, lhs)
...
end) If it still doesn't work even for one iteration, I'd ask you to call this function interactively once and test, i.e. execute By the way, I fixed the original code snippet to be actually useful for other |
Thank you @echasnovski , doing it in the I also have an issue with Closing this now as my personal issue seems to be solved with your code snippet One final question: do you think it would be beneficial/feasible to disable Reason I'm saying this: in a large file, if you're near the bottom and you do UPDATE: well, I think what I said above about "taking a while" is not 100% true. I think the total time of the animation is constant, am I correct? But my question still stands for my own curiosity 😝 |
Yes, this is not easily possible specifically because 'mini.animate' reacts on And yes, judging by your setup, total duration of any "scroll" animation should be 150 ms. It might be slightly greater on slow CPU or terminal emulator, but shouldn't be by much. |
Contributing guidelines
Module(s)
mini.animate
Description
I'm using
mini.animate
(and I love it), but I have an issue with relatively large files and when using vim-visual-multi.I do have a bunch of folds in the file, and when entering visual multi mode:
mini.animate
tries to animate this movement.The issues arises when the file, as I mentioned, is a large file. Seems like in this case visual multi mode tries to select the next occurrence while
mini.animate
is still animating the movement, and this creates an issue causing a random word to be selected as next occurrence.My config:
Neovim version
NVIM v0.9.1
Steps to reproduce
Sorry, didn't try the bug with minimal config; let me know if it's absolutely necessary and I can do that.
nvim
with a large file (say, 600 lines) that has a bunch of foldsctrl+n
) with cursor being on a word that's commonly used in the file (e.g.,echo
in a bash script file)vim-visual-multi
vim-visual-multi
selects the next word, but that doesn't match the cursor word.Expected behavior
If I use
neoscroll
, that animation doesn't happen, and there's no issue.Actual behavior
I'd love for
mini.animate
to not do this since I'm very dependent onvim-visual-multi
, but this conflict between the two plugins is a bit annoying.The text was updated successfully, but these errors were encountered: