fix(formatter): don't forget to add the indentation when a condition is on a newline #627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When a condition is on a newline, and the indentation level is more than 0, conditions were put at column 0, which is an error:
(let permutations (fun ((ref _L) _r _f) { (let _len (len _L)) (if (and (<= _r _len) (> _r 0)) { (mut _indices (iota 0 _r)) (if (!= stopIteration (_f (select _L _indices))) { (mut _continue true) (let _reversed_indices (reverse _indices)) (while _continue { (mut _i nil) (if - (forEach +(forEach _reversed_indices (fun (_val) { (set _i _val) (if (!= (@ _indices _i) (+ _i _len (* -1 _r))) stopIteration) })) { (@= _indices _i (+ 1 (@ _indices _i))) (mut _j (+ 1 _i)) (while (< _j _r) { (@= _indices _j (+ 1 (@ _indices (- _j 1)))) (set _j (+ 1 _j)) }) (if (= stopIteration (_f (select _L _indices))) (set _continue false)) } (set _continue false)) }) }) }) }))Checklist