vscode-better-align icon indicating copy to clipboard operation
vscode-better-align copied to clipboard

Tab indentation replaced by space indentation in PHP files in 1.4.0

Open BozzaDaniel opened this issue 2 years ago • 3 comments

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;
	}
?>

BozzaDaniel avatar Feb 02 '23 11:02 BozzaDaniel

This is happening on any type of file as of 1.4.0

GiancarloGomez avatar Feb 02 '23 16:02 GiancarloGomez

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

chouzz avatar Feb 06 '23 15:02 chouzz

@chouzz seems like this is still a problem:

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

MrFoxPro avatar Jul 14 '24 23:07 MrFoxPro