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
40 stars 4 forks source link

Tab indentation replaced by space indentation in PHP files in 1.4.0 #73

Open BozzaDaniel opened 1 year ago

BozzaDaniel commented 1 year ago

In version 1.4.0 the indentation is replaced by spaces if using tabs in PHP files. It doesn't happen in other formats such as typescript. The following example:

<?php
    $test = 123;
    $test123 = 456;

    if ($some_variable) {
        $testing = 'test';
        $testing_123 = 456;
    }
?>

Will result in this with 1.4.0:

<?php
 $test    = 123;
 $test123 = 456;

    if ($some_variable) {
  $testing     = 'test';
  $testing_123 = 456;
    }
?>

Instead of this (in 1.3.2):

<?php
    $test    = 123;
    $test123 = 456;

    if ($some_variable) {
        $testing     = 'test';
        $testing_123 = 456;
    }
?>
GiancarloGomez commented 1 year ago

This is happening on any type of file as of 1.4.0

chouzz commented 1 year ago

Seems we need consider more complex case, for example, what if align with mixed whitespce, for example:

    $test    = 123;  // This line contain 1 tab
        $test123 = 456;  // This line contain 8 whilte sapce
MrFoxPro commented 3 months ago

@chouzz seems like this is still a problem:

https://github.com/user-attachments/assets/cd469cd0-070d-4d4b-ad33-86d79db7158b