Skip to content

Folding causes the cursor stuck #40

Open

Description

@JS-Zheng

vim-smoothie version: b440f13
vim version: 8.2.4700

As mentioned in the title, when I use the scrolling commands (e.g., <C-D>, zt) to cross the continuous folding, the cursor will be stuck. Then, j and k cannot work normally, for example:

"""""""""""""""""""""""""
" +-- A (Fold)
"""""""""""""""""""""""""
"""""""""""""""""""""""""
" B {{{ (Fold)
"""""""""""""""""""""""""
[CURSOR] (`j/k` cannot work after `zt`)

" }}}
"""""""""""""""""""""""""
" C {{{ (Fold)
"""""""""""""""""""""""""
" }}}
"""""""""""""""""""""""""

Activity

  1. Freed-Wu commented on May 15, 2022

    @Freed-Wu

    I also met this similar bug, In a folded text contain about 1000 lines, press gg then G, then k cannot move, after waiting a few seconds or press za, it can recover to normal.

  2. AnkushMalaker commented on May 24, 2022

    @AnkushMalaker

    I can verify the same bug. I'd really like to continue using this plugin but this bug is a very common occurrence in my workflow. Could I contribute to fixing this somehow? I'm new to vim/vimL and would require some direction, though.

  3. Freed-Wu commented on May 24, 2022

    @Freed-Wu

    I believe this bug occur after #34. A older vim-smoothie can avoid this bug.

  4. psliwka commented on May 28, 2022

    @psliwka
    Owner

    Thanks for reporting! Unfortunately I couldn't figure out yet why does that happen. For now I added a workaround, which should cause the plugin to jump directly to the target position if it detects that animation is stuck. It's not pretty, but at least will prevent trapping users and their cursors ;)

  5. JS-Zheng commented on May 29, 2022

    @JS-Zheng
    Author

    Hi @psliwka,
    Thanks for workaround. IMHO, the problem may be because vim-smoothie does not consider the folded lines. Perhaps It can use foldclosedend() to calculate end line of folds.

  6. AnkushMalaker commented on May 29, 2022

    @AnkushMalaker

    @psliwka Thanks, you're the MVP. It doesn't get stuck after the update. If it helps diagnose at all, I use fzf with nvim and whenever I got this cursor stuck issue, I couldn't open fzf. I get an error with something along the lines of "Can't exit terminal mode and go into normal mode". Best of luck and thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions