-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
column number wrong when utf-8 double-wide character is substituted after conceal #14640
Comments
Related #4687 |
It appears that is a different issue, related to supporting string as substitute (instead of single character). The issue I reported is a bug. Column numbers (based on byte count) should not change when some character is concealed or substituted. What happens on screen (how many cells a character occupies) should not affect byte position in a string/line. |
I don't think byte position is wrong. If you press |
Good point, but the cursor (visual character on screen) is still on You can also move the cursor to the right (across the hidden character) and watch column numbers increment on the ruler. They'd be wrong too. |
Searching for a string also shows the bug. Say the cursor is on This bug is probably not of much interest since the scenario of substituting single-cell wide char with double-wide char is unlikely. Maybe of importance to non-English users. |
@girishji |
Steps to reproduce
Use the following script. It conceals letter 'g' with a double-wide char. Do
:call cursor(1, 10)
and cursor is placed onば
(correct). cursor(1,11) will place cursor oni
(correct). cursor(1,12) also places cursor oni
(wrong). On the ruler/statusline column numbers are wrong also, after theば
character.Expected behaviour
Column numbers are byte-based, and should not change when character is concealed or substituted.
Because of this bug, you can place the cursor using
cursor()
on some character, but when you get screen based column number usingwincol()
it would be wrong.Version of Vim
9.1
Environment
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: