-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Skip rendering gutters when gutter width exceeds view width #7821
Conversation
As I already mentioned in #7156 (comment) fixing this by just limiting the line number width is just a hack. You cos have a gutter with 20 spacers and a terminal width of 20 (the terminal width can even be 0). So instead of just limiting this setting the right way to fix this is ti perform bounds check before deciding to even draw gutter elements |
My apologies, I misunderstood as it just being an issue with The video showcased has 47 2023-08-04.16-35-57.mp4 |
is_focused, | ||
&mut line_decorations, | ||
); | ||
let gutter_overflow = view.gutter_offset(doc) == 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the right way to go about it or if gutter_offset
should return an Option<u16>
instead with None
in case of overflow
Closes #7154
Setting
gutters.line-numbers.min-width
to a value higher thanterminal_width * terminal_height
led to index out of bounds.My approach was to have the width of
LineNumbers
be capped at 90% of the viewport size. Everything works as expected until the threshold is reached, whenmin_width
is set to default value.2023-08-03.21-59-41.mp4