wizmer / syncorg

An implementation of MobileOrg for the Android platform
GNU General Public License v3.0
174 stars 23 forks source link

All content indentation lost on write #47

Open chrisberkhout opened 7 years ago

chrisberkhout commented 7 years ago

When a change is made, indentation is lost for the whole file. This is particularly disruptive for SRC and EXAMPLE blocks.

For example, when starting with:

* Top
** First
Content unindented
  Indented 2
    Indented 4
** Second
   Content indented
     Indented 2 more
       Indented 4 more
** Third
#+BEGIN_EXAMPLE
=============================
Example unindented
  Indented 2
    Indented 4
=============================
#+END_EXAMPLE
** Fourth
  #+BEGIN_EXAMPLE
  =============================
  Example indented
    Indented 2 more
      Indented 4 more
  =============================
  #+END_EXAMPLE

Adding a new child under Top updates the file to:

* Top
** New child of Top
** First
   Content unindented
   Indented 2
   Indented 4
** Second
   Content indented
   Indented 2 more
   Indented 4 more
** Third
   #+BEGIN_EXAMPLE
   =============================
   Example unindented
   Indented 2
   Indented 4
   =============================
   #+END_EXAMPLE
** Fourth
   #+BEGIN_EXAMPLE
   =============================
   Example indented
   Indented 2 more
   Indented 4 more
   =============================
   #+END_EXAMPLE
wizmer commented 7 years ago

OK. Fixed for next version.