Repository navigation
[Feature]: Honor .editorconfig tab width and optionally render whitespace in file and diff views #17978
Replies: 1 comment
|
Thanks for the clear write-up — this checks out. What’s going on File and diff views (file preview, working-tree/checkpoint diffs, and PR code review) all render through This is display-only. Nothing in the current path rewrites files or converts tabs to spaces. Not the same as existing whitespace settings
No duplicate of this feature request turned up. Suggested implementation (web/desktop first)
Mobile native review diffs do not use Pierre’s CSS tab-size, so they can be a follow-up. Happy to take a PR that stays display-only and covers file + diff together. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Projects that use tab characters can be difficult to read in T3 Code because tabs are currently always rendered at a fixed width of two spaces.
If a project's
.editorconfigdefines a different tab width, code that is correctly aligned in other editors appears compressed or misaligned in T3 Code. Deeply nested code becomes difficult to scan, and alignment based on tab stops can appear broken.This affects both file and diff views. It is also difficult to distinguish tabs from spaces when reviewing formatting-sensitive changes.
Proposed solution
Have T3 Code's file and diff views honor the applicable
.editorconfigsettings for each file:tab_widthwhen specified.indent_sizewhentab_widthis not specified..editorconfigsection based on the file path.This should only affect how existing tab characters are displayed. It should not rewrite files or convert tabs to spaces.
Additionally, add a Show whitespace characters setting for file and diff views:
Expected behavior
Given this
.editorconfig:Tab characters in source files should occupy four columns in file and diff views.
When Show whitespace characters is enabled, spaces and tabs should have distinct visible markers so indentation and whitespace-only changes can be reviewed accurately.
Example
All reactions