Skip to content
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

Folding causes the cursor stuck #40

Open
JS-Zheng opened this issue May 10, 2022 · 6 comments
Open

Folding causes the cursor stuck #40

JS-Zheng opened this issue May 10, 2022 · 6 comments

Comments

@JS-Zheng
Copy link

JS-Zheng commented May 10, 2022

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)
"""""""""""""""""""""""""
" }}}
"""""""""""""""""""""""""
@Freed-Wu
Copy link

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.

@AnkushMalaker
Copy link

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.

@Freed-Wu
Copy link

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

psliwka added a commit that referenced this issue May 28, 2022
@psliwka
Copy link
Owner

psliwka commented May 28, 2022

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 ;)

@JS-Zheng
Copy link
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.

@AnkushMalaker
Copy link

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants