# Make minimum width for line numbers in gutter configurable \(\#31959\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7d5a5d09841ead6e2fdf8436fcd445d4bc4e52f7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7d5a5d09841ead6e2fdf8436fcd445d4bc4e52f7

Requested commit: 7d5a5d09841ead6e2fdf8436fcd445d4bc4e52f7

Commit: 7d5a5d09841ead6e2fdf8436fcd445d4bc4e52f7

Tree: cd9bd97faac9b64765ad09fc2d303a889427d023

Author: Max Mynter

Committer: GitHub

## Message

```
Make minimum width for line numbers in gutter configurable (#31959)

Closes #7334

# Changes
This PR makes the minimum width allocated for line numbers in the side
gutter configurable in units of character width via the
`"line_number_base_width"` attribute in `gutter` settings. Set the
previously hard coded value of `4` as default.

Together with other settings (`"folds"`, `"breakpoints"`,...) this gives
the user control over the gutter width.

If the number of lines exceedes the base width, the number of digits in
the largest line number is chosen instead. This is consistent with
previous behaviour.

Screenshot for reference:
<img width="1104" alt="Screenshot 2025-06-03 at 12 15 29"
src="https://github.com/user-attachments/assets/77c869ad-164b-4b74-8e39-8be43d740ad4"
/>


P.S.: This is my first time contributing to zed (yay!🎉). Let me know if
i'm missing something.

Release Notes:

- Make minimum line number width in gutter configurable
```

## Parents

- [4c3ada57538a3e358d19130e99db51187e61bd1f](https://git.cafe/gitcafe/zed/commit/4c3ada57538a3e358d19130e99db51187e61bd1f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7d5a5d09841ead6e2fdf8436fcd445d4bc4e52f7?format=markdown)
