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

fix: Location component was showing wrong column with inlay hints. #1243

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

davidt
Copy link
Contributor

@davidt davidt commented May 20, 2024

The location component had been previously changed to use
vim.api.virtcol (the screen position of the cursor) instead of
vim.api.col (the byte position of the cursor), in order to prevent
showing the wrong column when multibyte characters are present.
Unfortunately, the new inlay hints in neovim 0.10 make heavy use of
virtual text, and therefore the column shown in the location component
is often incorrect.

This change fixes it to use vim.api.charcol, which correctly handles
variable-width characters without including virtual text.

The location component had been previously changed to use
`vim.api.virtcol` (the screen position of the cursor) instead of
`vim.api.col` (the byte position of the cursor), in order to prevent
showing the wrong column when multibyte characters are present.
Unfortunately, the new inlay hints in neovim 0.10 make heavy use of
virtual text, and therefore the column shown in the location component
is often incorrect.

This change fixes it to use `vim.api.charcol`, which correctly handles
variable-width characters without including virtual text.
@shadmansaleh shadmansaleh merged commit e208967 into nvim-lualine:master Jul 7, 2024
5 checks passed
@shadmansaleh
Copy link
Member

Thanks for the fix

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

Successfully merging this pull request may close these issues.

None yet

2 participants