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

Incorrect indentation of Twig switch statements. #495

Closed
eivindml opened this issue Nov 3, 2017 · 5 comments
Closed

Incorrect indentation of Twig switch statements. #495

eivindml opened this issue Nov 3, 2017 · 5 comments

Comments

@eivindml
Copy link

eivindml commented Nov 3, 2017

Hi,

it looks like prettydiff wrongly indents switch statements with Twig templates. Look at example below. Left hand, how it should be indented, right hand is how it actually is:

screen shot 2017-11-03 at 10 46 19

@prettydiff
Copy link
Owner

I can reproduce this failure in the latest version of Pretty Diff

{% for %}
{% switch block.type %}
{% case "test" %}
<p>asdf</p>
{% default %}
{% endswitch %}
{% endfor %}

Out of curiosity do you know what the sudden interest in Pretty Diff's Twig support is all about? I have had almost no feedback about Twig in the nearly 3 years I have provided support and then this week 3 valid defects related to Twig are opened. That and this Github repo has gotten about 20 Github stars this week.

@eivindml
Copy link
Author

eivindml commented Nov 3, 2017

Hmm. That's strange. I can say for myself that it's because Craft CMS is using Twig for templating. I know Craft is gaining popularity, and a lot of design and developer studios I know of are switching from Wordpress etc. to Craft.

But it might be something completely different.

@iamlinkus
Copy link

Hey @prettydiff, is this going to be fixed any time soon?

@DamirPecnik
Copy link

Yeah, I use GravCMS and we use TWIG in there also. Currently, use Atom with Beautify and I have issues like this... Also, Gantry 5 Framework is using the twig for Joomla, WordPress and Grav so fixing this would really be good.

@prettydiff
Copy link
Owner

I fixed this today in one of my many commits.

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

No branches or pull requests

4 participants