mini.nvim
mini.nvim copied to clipboard
Add option to have cursor not animate to past the edge of the buffer when wrapping is enabled
Contributing guidelines
- [X] I have read CONTRIBUTING.md
- [X] I have read CODE_OF_CONDUCT.md
Module(s)
mini.animate
Description
When wrapping is enabled, mini.animate animates the cursor as moving to past the edge of the buffer as if wrapping is disabled. An option to have a fix applied to work for wrapping would be great.
Thanks for the suggestion!
Yes, I've noticed it too and thought about fixing it. The problem here was to compute the proper target destination and proper intermediate places. As although the line is displayed wrapped, it isn't so internally (it is still a single line). So it would need some extra work with window views which are both not trivial and might be computationally (relatively) expensive.
I'll take a second look, though.
The problem here was to compute the proper target destination and proper intermediate places. As although the line is displayed wrapped, it isn't so internally (it is still a single line). So it would need some extra work with window views which are both not trivial and might be computationally (relatively) expensive.
From some initial brainstorming I had the idea to do just a basic calculation where you check if the cursor position's column is greater than the width of the window then to do a calculation to get the displayed position rather than the internal position by subtracting the width from the column number. I am not sure exactly how this would be implemented but I hope it helps!