Skip to content

[mini.animate] animation interferes with vim-visual-multi #448

@farzadmf

Description

@farzadmf

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:

  • I think visual multi expands the folds while in multi mode and restores them (collapses them)
  • This causes a "movement" in the window, and 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:

local animate = require('mini.animate')
require('mini.animate').setup({
  cursor = {
    timing = animate.gen_timing.linear({ duration = 80, unit = 'total' }),
  },
  resize = {
    timing = animate.gen_timing.linear({ duration = 100, unit = 'total' }),
  },
  scroll = {
    timing = animate.gen_timing.linear({ duration = 150, unit = 'total' }),
  },
})

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.

  1. Open nvim with a large file (say, 600 lines) that has a bunch of folds
  2. Open a single fold and enter visual multi mode (default ctrl+n) with cursor being on a word that's commonly used in the file (e.g., echo in a bash script file)
  3. Two things can happen:
    • There's either an unnecessary jump/animation in the window because of the folds being opened by vim-visual-multi
    • (the worse case) while a window animation is in progress, 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 on vim-visual-multi, but this conflict between the two plugins is a bit annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions