Skip to content

Skip comments when looking for the next form to align - #176

Merged
bbatsov merged 1 commit into
mainfrom
fix-align-blank-line-after-comment
Nov 7, 2026
Merged

bbatsov merged 1 commit into
mainfrom
fix-align-blank-line-after-comment

Conversation

@bbatsov

@bbatsov bbatsov commented Nov 7, 2026

Copy link
Copy Markdown
Member

A comment at the end of a line takes its newline, so after align-region stepped back to the end of a line the search found the comment again and treated it as a form. Before a blank line, as in {:a 1 ;; c followed by a blank line and the closing brace, that signalled "Invalid search bound (wrong side of point)", and before a binding with metadata it aligned to the metadata alone. clojure-mode skips the comment there, and the output now matches it.

A comment at the end of a line takes its newline, and align-region
steps back to the end of the line after a match on the next one, so the
search found the comment again and moved over it as a form.  Before a
blank line that put the match before the previous one, which made
align-region signal an invalid search bound, and before a binding with
metadata it measured the metadata alone as the binding's name.
@bbatsov
bbatsov force-pushed the fix-align-blank-line-after-comment branch from ab9b48c to 88b6db3 Compare November 7, 2026 09:23
@bbatsov
bbatsov merged commit d8e7c7e into main Nov 7, 2026
10 checks passed
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