Files
zed/crates/gpui_windows
Lukas Wirth 0294cfb58e gpui_windows: Preserve native tab advances (#66468)
## 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>
2026-11-03 10:11:37 +00:00
..