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

Different indent #21

Open
friedger opened this issue Feb 11, 2023 · 3 comments
Open

Different indent #21

friedger opened this issue Feb 11, 2023 · 3 comments

Comments

@friedger
Copy link

In the example below, the body of the second function has more indent than the body of the first function

(define-read-only (stx-sats-price (bh uint))
   (unwrap! (get payout (get-burn-block-info? pox-addrs bh)) u0))

(define-read-only (stx-sats-price-10 (bh uint))
     (/ (+ (unwrap! (get payout (get-burn-block-info? pox-addrs bh)) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u1))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u2))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u3))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u4))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u5))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u6))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u7))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u8))) u0)
         (unwrap! (get payout (get-burn-block-info? pox-addrs (- bh u9))) u0))
      u10))
@njordhov
Copy link
Member

Thanks for the report. Which formatting mode did you use? In the current version, the default "indent" mode retains the indentation of the source as long as an open parens is nesting properly to the right of the parent's opening parens, giving more author control to the indent. The "auto" formatting mode is more intrusive and should result in the same indent for both.

@njordhov
Copy link
Member

Coming soon: The unwrap! forms that are added together in the second function will align having the same indent.

@friedger
Copy link
Author

Still learning. I just used default.
Thank you for the clarification

@friedger friedger reopened this Feb 12, 2023
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

No branches or pull requests

2 participants