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

Greater than 99999 line file doesn't resize line number width #2583

Closed
dalanmiller opened this issue May 27, 2022 · 3 comments
Closed

Greater than 99999 line file doesn't resize line number width #2583

dalanmiller opened this issue May 27, 2022 · 3 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@dalanmiller
Copy link

dalanmiller commented May 27, 2022

Summary

When viewing a file that has more than 99,999 lines, anything more than the left five digits is squelched.

E.g. my /etc/hosts file.
Screen Shot 2022-05-27 at 11 19 55 pm

This gets quite confusing when viewing lines much higher:

Screen Shot 2022-05-27 at 9 35 48 pm

Reproduction Steps

Download this file:

100001.txt

:100001 and observe the line numbers being truncated.

Helix log

Probably not necessary? I didn't see any issues related.

Platform

macOS

Terminal Emulator

iterm2

Helix Version

helix 22.03 (d4e45fd)

@dalanmiller dalanmiller added the C-bug Category: This is a bug label May 27, 2022
@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label May 27, 2022
@the-mikedavis
Copy link
Member

The line number gutter has a fixed, constant width currently:

GutterType::LineNumbers => gutters.push((gutter::line_numbers, 5)),

Some ways to go about fixing this:

  • make the fixed-width configurable instead of a constant
  • make the width dynamic based on the line numbers within view or the maximum line number of the buffer

@EpocSquadron
Copy link
Contributor

I vote for the second, within buffer. Would save some space in smaller files. However I wonder if we keep the limit but cut off the beginning digits with an ellipsis character to avoid going nuts with space usage in massive files.

@archseer
Copy link
Member

archseer commented Nov 8, 2022

Resolved by #2583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants