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

PhpStorm use spaces instead of tabs after reformat .latte #46

Closed
Michal920920 opened this issue Sep 13, 2019 · 9 comments
Closed

PhpStorm use spaces instead of tabs after reformat .latte #46

Michal920920 opened this issue Sep 13, 2019 · 9 comments
Labels

Comments

@Michal920920
Copy link

Michal920920 commented Sep 13, 2019

Hi, from PHPstorm 2019.2 there is a problem with formatting latte templates after reformat. It's unable set tabs instead space in settings. So even the slightest edit in latte templates will cause complete reformatting.
The problem is just in latte macros - look at the picture.
Is there some solution how to switch formatt settings back to tabs?

Snímek z 2019-09-13 12-40-54

@podolinek
Copy link

Same here. All latte files after reformat lines replace double brackets to spaces.

@podolinek
Copy link

Psi Viewer screen:

latte file

@zakrava
Copy link

zakrava commented Oct 29, 2019

@JanTvrdik @matej21
Please make tabs vs. spaces and number of spaces selectable/configurable in settings.

@rozsival
Copy link

Interesting, after upgrading to PhpStorm 2019.3 the issue is gone. Anyone else can confirm that?

@kolinger
Copy link

Not for me. Tabs are still converted to spaces (with latest PhpStorm 2019.3).

@rozsival
Copy link

@kolinger Ok, it seems like that in my case it works in combination with .editorconfig.

[*.latte]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

In previous versions of PhpStorm, the EditorConfig plugin was external and I was facing this issue even with the mentioned setup. But as of 2019.3 the EditorConfig plugin was updated and it is now bundled in PhpStorm and it seems it helps. I tried it in multiple projects, Reformat Code now works as expected.

I understand this is not a proper solution, but for now, it might help others too.

@kolinger
Copy link

Yes, this works for me too. I placed .editorconfig in root directory of my projects with your contents. And after IDE restart latte is formatted properly everywhere. Thank you!

@Jigsik
Copy link

Jigsik commented Feb 27, 2020

.editorconfig works like a charm. Thanks!

@mesour
Copy link
Collaborator

mesour commented Mar 3, 2020

Fixed in 1.0.2. It can be set in code style settings for Latte in PHPStorm preferences

@mesour mesour closed this as completed Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants