janet-mode icon indicating copy to clipboard operation
janet-mode copied to clipboard

Improper formatting of data structures with keywords

Open xoich opened this issue 3 years ago • 0 comments

Formatting any datastructure will create these alternating indentation when keywords are present:

  [:foo
     1
   :bar
     2]

This is not done in spork/fmt and it creates problems, for example with janet-html:

[:html
     [:head [:title "Title"]]
   [:body
      [:p "paragraph 1"]
    [:p "paragraph 2"]]]

:body and :head, and the two paragraphs should be at the same indentation level.

This is how spork/fmt does it:

[:html
   [:head [:title "Title"]]
   [:body
    [:p "paragraph 1"]
    [:p "paragraph 2"]]]

xoich avatar Jun 05 '22 08:06 xoich