Problem description:
When auto wrap (either at window edge or after specified maximum characters) is on, a long line with mixed CJK characters and spaces will prematurely wraps at spaces.
Please refer to the attached image for example. The contents are several "This is a test. " (there is a space after the period) scattered among many "这是一个测试。" (no space after the circle period) The auto wrap happens prematurely at spaces rather than reaching window edge.
It seems the TXS editor simply treats a CJK sentence as a whole word (a very long ASCII word has the same behavior), while CJK sentences have no explicit word breaks and can be wrapped anywhere. The right (but not perfect) auto wrap done by the Windows Notepad is also provided in the attached image for comparison.
I believe the proper places to insert an auto wrap should be:
Better if excluding the following places:
P.S. Sorry for not reporting this problem in my previous ticket. This one is much less annoying but more common, and I even forget to mention it.
I made a search and found no tickets on this issue existed in this repo, but I found some complains on this issue on Chinese internet as early as 2013. Maybe this is a long-lasting one but no CJK user had ever reported it.
You are right. The default behavior is splitting at spaces. Only if there is no space on the line, we split at the last letter.
I'll have to look into this further to see how complicated a change would be.
Quite the contrary, it's better to post different bugs in different tickets. It's easier to keep the overview that way.
fixed: hg 4969 (a6f5f7300d19)
Wrapping will now happen before any CJK character. Additional rules like punctuation are not considered because that would get significantly more complex.