When using the translate_tabs_to_spaces settings, all
of the tabs of a file would be translated to spaces
even if they were not part of the formatted code. This
could be annoying with bigger file containing both spaces
and tabs for formatting.
The issue comes from the fact that we overwrite all of the
file even when formatting selected text. Therefore Sublime
would translate the copied tabs to spaces even when not part
of the formatted code.
To fix this, we simply temporarily disable the
translate_tabs_to_spaces setting and set it back once the code
has been copied.
When using the translate_tabs_to_spaces settings, all of the tabs of a file would be translated to spaces even if they were not part of the formatted code. This could be annoying with bigger file containing both spaces and tabs for formatting.
The issue comes from the fact that we overwrite all of the file even when formatting selected text. Therefore Sublime would translate the copied tabs to spaces even when not part of the formatted code.
To fix this, we simply temporarily disable the translate_tabs_to_spaces setting and set it back once the code has been copied.