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

Fix: improve comment indentation (fixes #514) #676

Merged
merged 3 commits into from
Nov 25, 2018
Merged

Fix: improve comment indentation (fixes #514) #676

merged 3 commits into from
Nov 25, 2018

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Nov 24, 2018

This PR fixes #514.

This PR modifies processNodeList() behavior.
It handles the tokens which are between nodes (e.g., comma tokens) as the same way as the nodes. After this PR, it handles the comments which are between nodes as well.

Then, validate() aligns comments that processNodeList() handled to the expected column. And it allows comments which are on the expected indent of the previous/next line in the same manner as before.

This fix will improve the comment indentation in templates, blocks, object literals, array literals, and class bodies.

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@michalsnik michalsnik merged commit 925190f into master Nov 25, 2018
@michalsnik michalsnik deleted the issue514 branch November 25, 2018 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

html-indent: Wants to indent comments too deep after multiline tags
3 participants