Fix drawing ambiguous-width character #2436
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem summary
Under the following conditions, Vim does not update the cells of unicode ambiguous-width character properly.
:set ambiwidth=double
Repro steps
Create 1.txt and 2.txt
vim --clean
\u03bb
is λ (lambda)1.txt:
2.txt: (
ambw=double
)Open 1.txt and 2.txt
vim --clean +'set ambw=double'
Result
z
of 1.txt remains just behind lambda of 2.txt.Details
When drawing a content of 2.txt, Vim outputs into terminal:
Vim treats lambda as 2 cells but terminal treats it as 1 cell, so (row=1, col=4) cell is not updated.
Solution
ambw=double
)