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

Add option to have cursor not animate to past the edge of the buffer when wrapping is enabled #695

Open
2 tasks done
WildRage1369 opened this issue Feb 12, 2024 · 2 comments
Labels

Comments

@WildRage1369
Copy link

Contributing guidelines

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.

@echasnovski
Copy link
Owner

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.

@WildRage1369
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants