mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-26 10:33:15 +01:00
0294cfb58e
## Summary Fix zero-width tabs in GPUI text on Windows by preserving DirectWrite’s native tab advances. DirectWrite represents tabs as zero-glyph drawing runs. GPUI previously skipped those runs and accumulated only glyph advances, losing tab spacing. Query each tab’s native hit-test width and include it in the accumulator, with an invisible space-glyph entry for caret/index mapping. Keep the original text, DirectWrite’s native tab-stop policy, and GPUI’s existing logical-order glyph placement. This does not introduce a four-space policy or attempt to unify tab stops across platforms. ## Attribution Follow-up to #66455 by @leafyoung, which identified the zero-width tab issue and proposed a fix. This takes a different implementation approach using native layout advances. Release Notes: - [GPUI] Fixed zero-width tabs in text on Windows by preserving native DirectWrite tab advances and caret positions. Co-authored-by: Yang Ye <yangye@techntea.com>