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

Format: insert space between { and % to prevent writing {% #5278

Conversation

makenowjust
Copy link
Contributor

Fixed #5277

I think it is the best solution because it treats same thing against {{ already.

Fixed crystal-lang#5277

I think it is the best solution because it treats same thing against `{{` already.
@RX14
Copy link
Contributor

RX14 commented Nov 12, 2017

This is so ugly but I think its the only solution.

end

# This is to prevent writing `{%`
if @token.raw.starts_with?("%")
Copy link
Member

Choose a reason for hiding this comment

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

Why not make this a joint if condition to avoid duplication?

Copy link
Contributor

Choose a reason for hiding this comment

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

btw, argument passed to starts_with? call here could be a Char instead of String.

@luislavena
Copy link
Contributor

Hello @mverzilli and @bcardiff, can we get your approval on this PR?

Thank you.
❤️ ❤️ ❤️

@mverzilli mverzilli merged commit 24ee423 into crystal-lang:master Nov 24, 2017
@mverzilli mverzilli added this to the Next milestone Nov 24, 2017
@makenowjust makenowjust deleted the fix/crystal-format/5277-insert-space-between-brace-and-percent branch November 24, 2017 15:28
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.

None yet

7 participants