Closed antoinegomez closed 2 years ago
@pulse00 Is possible add the indentation width option? That makes a big difference for us (we used 2 spaces for HTML indenting).
@antoinegomez @marcospassos The Twig Editor is based on the PHP ScriptEditor, this means that if you want to change indentation size or tabs/spaces for indentation, you can change it in Preferences -> PHP -> Code Style -> Formatter
Unfortunately it's not possible currently to have different indentation in twig templates and PHP files.
That should be added asap in my opinion. Twig templates are not the same as PHP files, it's printing HTML so it should use the settings for HTML.
I agree with that, it's a mandatory change.
+1
For what it worth, I am using a PHP codestyle with 2 as indentation, but twig remains with 4 spaces
For some reason, this plugin always indents using spaces for me, even though Preferences -> PHP -> Code Style -> Formatter
says Tab policy: Tab.
At first, I thought that it might be ignoring the Tab policy: Tab setting and always using spaces (as specified in Tab size). However, changing Tab size doesn't affect the plugin.
.. so it seems like the plugin always uses 4 spaces and there's no way around that, unfortunately.
currently twig should use html editor settings, not php
How is it possible to switch the indentation settings ?
Using Aptana, in the preferences I specified to use spaces for indentation, no config option for that in Twig editor.