-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Unicode support for breakat
so that linebreak works with unicode languages (Japanese, Chinese etc)
#13967
Comments
Breaking for any unicode character wouldn't work, because then lächeln would break on ä, etc. The only way to handle this that I see is to check for the unicode group and break at certain groups. Perhaps give a setting for which ones? Gives up some of the control of the |
@worldeva I see what you mean. After checking, I didn't realize actually that there are basically no languages (not programming 😝 ) that use strictly ASCII characters. English also uses unicode characters. For reference, I believe you are referring to unicode blocks as defined like this? I think it's a good idea that you have: 1 - define which unicode blocks should break I don't think there are a lot of blocks (read: languages) that need that kind of special treatment. For a languages that use mostly latin lettering, I believe they will use the normal ascii spaces etc and the default way vim wraps and breaks seems to work fine. In regards to performance, I think it should be off by default and enabled by a setting. I'm sure a majority of vim/nvim users do not need this. I wouldn't have this on for a python file but I would turn it on for markdown, for example. |
Well- |
That looks like a lot to sort through, thank you! |
I wonder if unicode support could be added for breakat.
Personally I write with unicode (Japanese) and linebreak doesn't work for it. In something like markdown you end up getting some weird things. The lines do wrap, however, for something like a blockquote you would get the following for a line (breaks at the space):
> 日本語とか。。。
:help breakat states the following --
I don't know how linebreak works internally - but I wonder I summize the following logic may be enough:
If it's possible to implement that kind of logic, in the case of Japanese and Chinese I believe this would work fine. It's literally just a long line of non-stop unicode. Perhaps other languages are similar but I'm not sure about that.
よろしく!
The text was updated successfully, but these errors were encountered: