Fix: auto spacing detection doesnt work reliabily #1828
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
We've updated the behavior of the
Tab Size
setting in auto mode to address a misunderstanding in its implementation. Previously, we incorrectly equated theTab Size
with the number of tab characters used for indentation in a file. This has been corrected to reflect a more standard approach, ensuring a consistent and intuitive editing experience across various files.Detailed Explanation:
The
Tab Size
setting determines the display width of a single tab character on the screen, not the number of tab characters used for indentation. In our previous approach, if a file was auto-detected to use two tab characters for indentation, we mistakenly set theTab Size
to 2. This interpretation was incorrect asTab Size
should define the width in spaces that a tab character occupies, which is conventionally 4 spaces.New Behavior:
In auto mode, we now standardize the
Tab Size
to a fixed value of 4 spaces. This change means:number of tabs x 4 spaces
. This ensures that the visual representation of indents remains consistent and clear.Examples for Clarity:
Tab Size
: 2Tab Size
in auto mode: 42 tabs x 4 spaces = 8 spaces
per indent levelUser Customization:
Tab Size
for individual files via the status bar if specific adjustments are needed. However, global overrides forTab Size
are not available to maintain uniformity in auto mode.This update aims to standardize how tab widths are handled in the editor, simplifying the user experience and preventing inconsistencies in text alignment and appearance.