-
Notifications
You must be signed in to change notification settings - Fork 278
fix(window): improve cursor screen position calculation for multibyte chars #1853
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
Conversation
… characters Update get_cursor_screen_position to use display width for accurate column indexing and add error handling for screenpos failures. This ensures correct positioning with wide or multibyte characters and prevents runtime errors.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Indeed the fix suggested in #1874 seems to work and is cleaner. |
I'm using this and it's fine, doesn't break anything! waiting for the merge! |
I'd like to figure out why we need to use the |
Because this bug has been introduced by upstream commit eeacd7bd71 and from what I can tell, this change made the parent window logic stricter. So we cannot rely on We can use also simply local pos = vim.fn.screenpos(0, cursor_line, cursor_column) |
Thank you all! |
Update get_cursor_screen_position to use display width for accurate column indexing and add error handling for screenpos failures.
This ensures correct positioning with wide or multibyte characters and prevents runtime errors.
Fixes #1851