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 the misalignment of foldtext in the presence of CJK characters #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomtomjhj
Copy link
Contributor

Handle characters such that len(c)>2 and strdisplaywidth(c)=2.

Current (buggy) (with g:vim_markdown_folding_style_pythonic == 1)
image
On line 15, I typed two Korean characters whose len is 3 and strdisplaywidth is 2. As a result, the fold text for that line is 2 characters off.

Fixed
image
With this patch, the line counts are now properly alligned.

Handle characters such that len(c)>2 and strdisplaywidth(c)=2.
@tomtomjhj tomtomjhj changed the title use strdisplaywidth when computing foldtext Fix the misalignment of foldtext in the presence of CJK characters Sep 2, 2020
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

1 participant