# editor: Add configurable git gutter width setting \(\#61304\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 35cb7558a9d9a6f2eaf31ce2e4dce4a0575820ef

Requested commit: 35cb7558a9d9a6f2eaf31ce2e4dce4a0575820ef

Commit: 35cb7558a9d9a6f2eaf31ce2e4dce4a0575820ef

Tree: acfabf08521b41b11372807a13c9ec399eef7263

Author: Evan Vinciguerra

Committer: GitHub

## Message

````
editor: Add configurable git gutter width setting (#61304)

## Summary

Adds a `gutter.git_gutter_width` setting that lets users pin the width,
in pixels, of the git diff hunk indicators in the editor gutter.

Previously the width was always derived from the buffer font size
(`floor(0.275 * line_height)`), which can render too thin or too thick
depending on font family and display pixel density. This adds an
optional override:

```json
{
  "gutter": {
    "git_gutter_width": 6
  }
}
```

When the setting is unset (`null`, the default), the width continues to
scale with the buffer font size, so existing behavior is unchanged.

## Motivation

Requested in [discussion
#27799](https://github.com/zed-industries/zed/discussions/27799). Beyond
the width itself, participants noted the git hunk hit target is
extremely narrow and hard to click. Because the hunk hitbox reuses the
painted strip bounds, setting a wider `git_gutter_width` also widens the
clickable area, addressing that complaint with the same setting.

## Changes

- `settings_content`: new `git_gutter_width: Option<f32>` on
`GutterContent`.
- `editor`: mirror field on the resolved `Gutter`; `gutter_strip_width`
now consults the setting, and the value flows through `diff_hunk_bounds`
(including the deleted-hunk marker) and the gutter layout anchors for
line numbers, folds, and expand toggles.
- `settings` (VS Code import): pass through the new field.
- Docs + `default.json`: document the new setting.

## Notes

- `Eq` was dropped from `GutterContent`/`Gutter` because `f32` is not
`Eq`; this matches the existing `EditorSettingsContent` convention for
float-bearing settings.

Release Notes:

- Added a `gutter.git_gutter_width` setting to configure the width of
git diff indicators in the editor gutter

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
````

## Parents

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

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