Skip to content

:stair does not behave like documented when multiple arguments on first line #97

@bullfest

Description

@bullfest

The documentation says

A :stair rule is similar to :block, except that it tries to indent test/expression clauses as pairs.

From this I'd expect the following snippet to be correctly formatted when having the indentation rule {cond [[:stair 0]]}

(cond (pos? n) 
        1
      (neg? n) 
        -1
      :else 
        0)

but it's formatted to

(cond (pos? n) 
    1
  (neg? n) 
    -1
  :else 
    0)

Same with

(cond (pos? n) 1
      (neg? n) -1
      :else 0)

which is formatted to

(cond (pos? n) 1
  (neg? n) -1
  :else 0)

The most reasonable behaviour in my mind for :stair is to have a base indentation that matches :block, and then add extra indentation for every other element after the one that the index is provided for.

I think it should be reasonable enough to have the same index be the basis for the :block and :stair parts of the rule.

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