Menu

#1259 Premature auto wrap in a long line with mixed CJK characters and spaces

None
fixed
nobody
None
1
2015-03-07
2015-03-04
Fang Zhang
No

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:

  • after spaces;
  • between two CJK characters.

Better if excluding the following places:

  • after (but not before) left-pair CJK punctuations like "【(“‘「『[《〈"
  • before (but not after) other CJK punctuations.

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.

1 Attachments

Discussion

  • Tim Hoffmann

    Tim Hoffmann - 2015-03-04

    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.

    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.

    Quite the contrary, it's better to post different bugs in different tickets. It's easier to keep the overview that way.

     
  • Tim Hoffmann

    Tim Hoffmann - 2015-03-07

    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.

     
  • Tim Hoffmann

    Tim Hoffmann - 2015-03-07
    • status: open --> fixed
    • Group: -->
     

Log in to post a comment.