Files
oak-gpui/crates
Max Mynter 242af863f5 Use ch-width (0) instead of em-width (m) for gutter width calculation (#32548)
Closes #21860

Release Notes:

- Added `ch_width` and `ch_advance` function alongside their `em_*`
counterparts
- Use `ch_*` version to calculate gutter layouts
- Update a stale comment from changes in #31959

The ch units refer to the width of the number `0` whereas em is the
width of `m` and the actual font size (e.g. 16px means 16 px width of
`m`).

This change has no effect for monospaced fonts but can be drastic for
proportional ones as seen below for "Zed Plex Sans" with a
`"min_line_number_width" = 4`.

<img width="726" alt="Screenshot 2025-06-11 at 15 47 35"
src="https://github.com/user-attachments/assets/aa73f4d4-32bc-42cf-a9f6-7e25fee68c9a"
/>
2025-06-12 08:28:04 +03:00
..
2025-06-09 18:07:22 +00:00
2025-06-05 12:59:22 +00:00
2025-06-11 22:44:20 +03:00
2025-06-02 21:24:08 +00:00
2025-05-01 19:24:14 +00:00
2025-05-29 15:20:58 -04:00
2025-06-10 19:57:46 -06:00
2025-06-11 15:41:41 +00:00