Menu

#220 More soft wraps not only at whitespaces (ASIAN LANGUAGES)

closed-accepted
None
5
2012-02-11
2009-01-03
No

This patch implements more soft wraps not only at
whitespaces (as it is now), but also at breaks
determined by java.text.BreakIterator as suggested in
bug #574189.
https://sourceforge.net/support/tracker.php?aid=574189

Without some change like this patch, the soft wrap
feature is not so useful for languages which don't use
spaces as word breaks (ex. Chinese, Japanese, ...).

By using BreakIterator, some basic rules of line
wrapping are applied. But they are for natural
languages (and locale dependant), not for programming
languages. I'm worried about that this can cause some
unexpected behavior.

Please test. If no one objects, I'll apply this patch
on trunk after some more testing period (possibly a
week or so).

Discussion

  • Alan Ezust

    Alan Ezust - 2009-02-06

    If it does not affect programming mode langauges, but only natural languages, I have no problem with you committing this patch.

     
  • Kazutoshi Satoda

    Unfortunately, this doesn affect programming mode, too. For example,
    "x.foo()" could be broken at the next of the period.

    I'm seeking some solution to select, or unify the two algorithms to
    find line breaks; the one now jEdit does, and the one BreakIterator
    does.

     
  • Alan Ezust

    Alan Ezust - 2010-11-25

    If I am not using a language which uses spaces, how can i test it? Does this mean only people who are using those languages will notice any difference at all?

     
  • Kazutoshi Satoda

    • status: open --> open-invalid
     
  • Kazutoshi Satoda

    Thank you for looking into the patch. Now I remembered that I have a
    revised patch which includes a possible solution for the problem I
    mentioned in the last comment. The revised patch is attached.

    But I already noticed that the patch is still unacceptable, because the
    patch doesn't work well for multiple token types, which had not been
    tested at the time I created the 2 patches.

    Except that, you can test the patch to check if it doesn't makes any
    other unintended side effects. The difference should be noticeable only
    for people who are using those languages.

     
  • Alan Ezust

    Alan Ezust - 2011-12-07
    • summary: More soft wraps not only at whitespaces --> More soft wraps not only at whitespaces (ASIAN LANGUAGES)
    • status: open-invalid --> pending-invalid
     
  • Alan Ezust

    Alan Ezust - 2011-12-07

    Should this be closed then?

     
  • Alan Ezust

    Alan Ezust - 2011-12-09
    • status: pending-invalid --> open-remind
     
  • Alan Ezust

    Alan Ezust - 2011-12-09

    Setting to "remind" which means this patch is awaiting further testing by other developers.

     
  • Alan Ezust

    Alan Ezust - 2011-12-11

    While testing, I noticed it does not resolve issue# https://sourceforge.net/tracker/?func=detail&aid=1624755&group_id=588&atid=350588
    Is there a way I can see it wrap long lines that have no spaces without switching to japanese?

     
  • Kazutoshi Satoda

    svn diff for jEdit/trunk r21102

     
  • Kazutoshi Satoda

    Another revised patch is attached. Now it passes all my manual tests
    including about performance.

    It contains so many logical units of change that shouldn't be in a
    single revision. I'll start committing separate revisions for each
    logical unit in the patch.

    About the linked FR #1624755, it is not in scope of this patch. However,
    it will be far easier to implement after this patch. The detection of
    line breaks is completely decoupled from syntax token boundaries, and
    encapsulated in a simple class; LineBreakIterator which implements
    java.text.BreakIterator.

    Testing without Asian text are also welcome to detect unwanted side
    effects.

     
  • Kazutoshi Satoda

    svn diff for jEdit/trunk r21106

     
  • Jarek Czekalski

    Jarek Czekalski - 2012-02-09

    If I have a very long line like aaaa/bbbb/cccc... it doesn't break at all in jedit now. Will this patch enable it? In text mode? In xml and other modes?

     
  • Kazutoshi Satoda

    No. That's FR #1624755. It is said that this patch would satisfy the FR,
    but it was said for the first version of this patch, which broke
    "x.foo()" at the next of period. The current version doesn't break it.
    Please see DisplayTokenHandler.LineBreakIterator.isAcceptableBreak() for
    the actual condition.

    Re-reading FR #1624755, I got lost about what kind of line breaks the FR
    (and you) want for non-Asian text. I think it's better to create a fresh
    FR with more specific description about what text should be broken,
    under what condition.

     
  • Kazutoshi Satoda

    • assigned_to: nobody --> k_satoda
    • status: open-remind --> closed-accepted
     
  • Kazutoshi Satoda

    The core change in the patch is committed in r21116. Closing this item
    as accepted (by myself).

    Remaining changes in the patch are not so important. They will be
    committed later as my low priority tasks.

     

Log in to post a comment.

MongoDB Logo MongoDB