Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bullfest opened this issue Feb 21, 2023 · 0 comments · May be fixed by #98
Open

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

bullfest opened this issue Feb 21, 2023 · 0 comments · May be fixed by #98

Comments

@bullfest
Copy link

bullfest commented Feb 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant