Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line number gutter width control #7334

Open
1 task done
krstp opened this issue Feb 3, 2024 · 12 comments
Open
1 task done

Line number gutter width control #7334

krstp opened this issue Feb 3, 2024 · 12 comments
Labels
design [core label] editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] setting Feedback for preferences, configuration, etc

Comments

@krstp
Copy link

krstp commented Feb 3, 2024

Check for existing issues

  • Completed

Describe the feature

I would like to be able to control the line-number gutter width.

If applicable, add mockups / screenshots to help present your vision of the feature

Now it is:
Screenshot 2024-02-03 at 12 39 56 PM
where I would like to be able to narrow it to something like this:
Screenshot 2024-02-03 at 12 40 47 PM

@krstp krstp added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Feb 3, 2024
@diocletiann
Copy link

Option to turn off the folding arrow area would be nice as well.

@JosephTLyons JosephTLyons added design [core label] editor Feedback for code editing, formatting, editor iterations, etc setting Feedback for preferences, configuration, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Feb 6, 2024
@den-is
Copy link

den-is commented Apr 20, 2024

The "line number" column is huuuuge!

@Caleb-T-Owens
Copy link

Hi! I've been trying out zed today and really enjoying it. The number column is however bonkers and is taking up 8% of my screen!

If a first step was to even just have an option to hide the line numbers, that would be great

@krstp
Copy link
Author

krstp commented May 15, 2024

@Caleb-T-Owens you can turn on/off line numbers with CMD+;

@SomeoneToIgnore
Copy link
Contributor

SomeoneToIgnore commented May 15, 2024

Also, see default settings for a more permanent solution:
image

@Caleb-T-Owens
Copy link

Thanks @krstp and @SomeoneToIgnore ; Disabling code actions and folds seems like the best options for me 👍

@manaskarekar
Copy link

Another request to add adjustable gutter width. Thank you.

@galenelias
Copy link
Contributor

The current logic is explicitly reserving 4 digits of line number space to avoid resizing the gutter as more lines are added.

This was done explicitly in #4135.

It seems like either not reserving anything, or maybe just reserving two or three digits would be preferable for some folks. Seems like the transition from 999 lines to 1000 is likely pretty rare, and some gutter size jump might be acceptable.

@brainrake
Copy link

This problem is way worse with proportional fonts (i know, niche), here's how it looks with code actions and folds disabled:
screenshot-2024-09-20-19:42:06
Looks like a very wide character is used to determine the width, perhaps max width of digits would be more appropriate.

Disabling code actions doesn't change the width, it just hides the action icons.

Wouldn't it make sense to reserve as many digits as needed for the number of lines in the file? There would be no jumps and no wasted space.

In any case, a gutter width setting would be appreciated.

@galenelias
Copy link
Contributor

Looks like a very wide character is used to determine the width, perhaps max width of digits would be more appropriate.

It is using the letter 'm', which for a proportional font would likely be fair bit wider than the widest digit.

Wouldn't it make sense to reserve as many digits as needed for the number of lines in the file? There would be no jumps and no wasted space.

I believe the choice to use such a large width is specifically to avoid the visual jumps when the file goes from 9 -> 10 lines, from 99 -> 100, and 999 -> 1000, etc. Looks like VSCode has similar logic, although they only reserve 3 characters of width, not 4.

@uyen9vba
Copy link

uyen9vba commented Oct 7, 2024

Gutter width would be delightful. +1

@echostain
Copy link

It seems like either not reserving anything, or maybe just reserving two or three digits would be preferable for some folks.

Especially for those using relative line numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design [core label] editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] setting Feedback for preferences, configuration, etc
Projects
None yet
Development

No branches or pull requests