amake / org_flutter

Org Mode widgets for Flutter
MIT License
17 stars 4 forks source link

Preserve line breaks if not in reader mode #6

Closed nyxkn closed 1 year ago

nyxkn commented 1 year ago

Hey @amake. This here is a trivial implementation of amake/orgro#73. Simply skip the text reflowing if not in reader mode.

Would you be happy with this solution? Or would you rather have a separate toggleable option next to reader mode?

Personally, I think this solution fits well and is an appropriate interpretation of reader mode.

amake commented 1 year ago

This looks like it's on the right track, but did you try it and see if the effect is what you want? There are several more call sites for reflowText so I'm not sure this is sufficient.

nyxkn commented 1 year ago

Ah, you are right, I hadn't noticed. This works fine for paragraphs but lists need some extra work.

I'll add the same behaviour to lists as well for consistency.

nyxkn commented 1 year ago

Now works on lists too.

For reference, this is the test org file I used, and all seems to work correctly:

foo bar
baz baz

1. list
   newline
   - nested list
     nested newline very long very long very long very long very long very long very long very long
     nested newline2
     - nested nested list
       nested nested newline
     - second element
2. list2
   newline2

* header
foo bar
baz baz
** subheader
foo bar
baz baz
- list
  newline
  - nested list
    nested newline
*** subsubheader
foo bar
baz baz