chouzz / vscode-better-align

Better vertical alignment with/without selection in any language.
https://marketplace.visualstudio.com/items?itemName=Chouzz.vscode-better-align&ssr=false#overview
Apache License 2.0
39 stars 4 forks source link

Version 1.4.1 messes up html formatting in PHP #79

Open murugappanrm opened 1 year ago

murugappanrm commented 1 year ago

In my index.php in the body section: This is the code entered:

<body>
        <form action="">
            <input type="text" name="" />
        </form>
 </body>

After saving the file, the formatting is messed up as:

<body>
        <form action  =  "">
         <input type  =  "text" name  =   "" />
        </form>
</body>

This happens when I enable "Align After Type Enter" .

chouzz commented 1 year ago

This is expected behavior, I think you can use shortcuts(alt+A) instead.

murugappanrm commented 1 year ago

Its ok. I fixed it. This extension was dependent on another extension for PHP. I corrected the setting in PHP and it works fine now. Except that the auto alignment does not work. I tested on 2 machines. I have to resort to key shortcuts. However it works fine in HTML scripts.

jonnylink commented 1 year ago

Not sure what the use case is for aligning on these elements...

lexman1958 commented 1 year ago

There was no use case. It was settings in the Extension which caused the misalignment. I removed the setting and it works fine. I am not sure why this setting exists in the first place. The only problem is that that auto align does not work.