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

Hamlet TextMate rule improvements #29

Merged
merged 6 commits into from
Apr 18, 2021

Conversation

mixphix
Copy link
Contributor

@mixphix mixphix commented Apr 17, 2021

Hello! This pull request addresses several bugs in the Hamlet syntax highlighting.

Let me begin with a side-by-side comparison of the syntax highlighting with current master and with my changes.

Current master:
hamlet-syntax-old

bi-functor/conditional-attribute-highlight:
hamlet-syntax-new

The most noticeable change is on line 6. Conditional attributes no longer highlight the entire row: in between the colons is formatted as interpolated code, and only the attribute following the second colon is highlighted as such.

Attribute properties in string format, such as "button" on line 13, are highlighted in a separate colour as well. They permit interpolation within themselves as well as evidenced on line 6.

Tag names are now specially highlighted, to distinguish them from attributes.

Also, CSS class selectors now highlight the dashes between words, not just the underscores.

Some scopes have been renamed according to the Sublime Text Scope Naming guide: mostly replacing embedded with interpolation and making sure that interpolated Haskell source code has the proper name (source.haskell.embedded).

@mixphix mixphix force-pushed the conditional-attribute-highlight branch from 0f12074 to ffdb8d5 Compare April 17, 2021 17:46
@waddlaw waddlaw self-requested a review April 18, 2021 06:37
@waddlaw waddlaw merged commit 23fd402 into e-bigmoon:master Apr 18, 2021
@waddlaw
Copy link
Contributor

waddlaw commented Apr 18, 2021

@bi-functor That's awesome! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants