pseewald / vim-anyfold

Language agnostic vim plugin for folding and motion based on indentation.
MIT License
268 stars 11 forks source link

Cursor jumps to top of class after folding #44

Open igbanam opened 1 year ago

igbanam commented 1 year ago

So I have this issue where… when writing a Ruby class, the cursor jumps to the top of the class after I write a method in it. I originally thought this was some Ruby plugin enforcing best-practices, but that's not the case. Turns out vim-anyfold tries responds to TextChangedI and tries to recompute folds on the fly. The behaviour I see is that it tries to fold the class soon as the end keyword for the function is typed.

I tried this on a test PHP file, and anyfold only folds on InsertLeave

Any ideas?

https://user-images.githubusercontent.com/390059/205487493-f6a2c642-0d0d-4e5a-ad6b-4aaf758ae991.mov