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

Fix: [line-number-mode] - Wrapped line attributes & Uniform number width #1732

Merged
merged 3 commits into from
Jan 4, 2025

Conversation

Encryptoid
Copy link
Contributor

This change is fixes 2 bugs with line-numbers-mode. They are broken up into 2 commits if you wish to view the changes individually. Line numbers are looking a lot smoother now.

Wrapped lines have no font attributes

Currently, wrapped lines do not have the same font attributes as the line numbers and it looks very strange.

I moved the computation of the wrapped left area to a generic and removed the implementation(not needed when no line numbers). line-numbers-mode then implements this generic to allow using it's attributes to highlight the blank spaces.

I could have just exposed the attribute, but this is now matching with the unwrapped lines, and it allows more flexibility in extensions(adding icons to wrapped lines, etc.)

Before:
image

After:
image

Line numbers format match max buffer lines

This is a fix for my own issue: improve: [line-numbers-mode] - Sync line format with lines that are displayed

I looked at a few editors, and most of the handle this by making the line number width for all lines match the amount of digits in the last line of the buffer. Some base it of the visual lines on the screen(if you can see a higher digit), but it's fully customizable via a minor mode now so people can change it if they wish.

Before:
image

After:
image

@cxxxr cxxxr merged commit c3ad998 into lem-project:main Jan 4, 2025
2 checks passed
@cxxxr
Copy link
Member

cxxxr commented Jan 4, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants