Skip to content

Don't count discarded forms for the position of an inner rule - #711

Open
bbatsov wants to merge 1 commit into
masterfrom
skip-discarded-inner-index
Open

bbatsov wants to merge 1 commit into
masterfrom
skip-discarded-inner-index

Conversation

@bbatsov

@bbatsov bbatsov commented Nov 3, 2026

Copy link
Copy Markdown
Member

A #_ form before letfn's bindings shifted their position by two, since moving back over it takes one step for the form and one for the #_, so the functions got indented like calls. Discarded forms don't count there now, which is what cljfmt and clojure-ts-mode do.

The position of a form inside the one whose indent spec applies was
counted by moving back over its siblings, and moving back over a
discarded form takes two steps, one for the form and one for its #_.
So a #_ form before the bindings of letfn gave them position 2 instead
of 1, and their functions got indented like calls.  Now neither counts,
as cljfmt and clojure-ts-mode skip discarded forms there too.
@bbatsov
bbatsov force-pushed the skip-discarded-inner-index branch from 8ccb0ce to 210e875 Compare November 3, 2026 13:45
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 this pull request may close these issues.

1 participant