Skip to content

Incorrect indentation in org-mode #24

@jaidetree

Description

@jaidetree

Reproduction

  1. Enable indentation in org_mode (default) or set org_indent_mode to indent
  2. Create at least two levels of headlines and add a src block (see example below)
  3. Invoke the FeMaco binding on the src block
  4. Update the src block content indentation (like ggVG=)
  5. Use the :wq command to write and replace prev src block

Example

#+title: Org FeMaco Indentation Repro

* Heading 1

  ** Heading 2

     #+begin_src fennel
     (let [x 5]
     (+ x 2)) ;; Purposefully incorrectly indented 
     #+end_src

Expected

The indentation level after saving the FeMaco buffer should respect the original org-mode src block indentation

* Heading 1

  ** Heading 2

     #+begin_src fennel
     (let [x 5]
       (+ x 2)) ;; Now correctly indented 
     #+end_src

Actual

The indentation level does not reflect the org-mode src block indentation:

* Heading 1

  ** Heading 2

     #+begin_src fennel
     (let [x 5]
(+ x 2)) ;; Now worse than before :(
     #+end_src

Workarounds

  • For now I've just set org_indent_mode to noindent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions