-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adds support for right-hand gutters and Scrollbar gutter item #5749
base: master
Are you sure you want to change the base?
Adds support for right-hand gutters and Scrollbar gutter item #5749
Conversation
This is not really a fault of this PR but there is currently a larger change to editor rendering underway in #5420.
|
@pascalkuthe no worries! I'm fine with rebasing onto your changes. I gave it a try preemptively based on the current contents of your PR and it seems like the right gutter is still rendering correctly, though I'll have to adjust the math for the scrollbar position. In the meantime, should I convert this PR to a draft until #5420 is merged? Or is there a different way you'd like me to proceed? |
It would have been fine to leave the PR as is, we have a label that we put in PRs that are based on other. Howbwr #5420 has been merged into master today so you can just rebase off master |
Sorry, I meant that I performed a quick rebase locally, just to see how big of a conflict I was in store for. I still have some cleanup and validation to do before I'm ready to push that rebase here, but I'll try to get that done within the next few days. Thank you for the heads-up! |
a481687
to
0be1687
Compare
I have rebased my changes onto a fresh copy of
The changes in Point 3 above (localized for now in the 3rd commit on this PR) could definitely benefit from some more-experienced eyes than my own, if that functionality is going to be considered for merge. I'm still fairly new to Rust and I suspect there's a better way for me to be tracking the viewport's position during the text rendering iteration. I've included some screenshots below for an overview of how this branch looks in use, in case that makes things easier for anyone interested. Line numbers enabled for right-hand gutter (left-hand gutter is explicitly set to default layout):Right-hand gutter set to
|
0be1687
to
c96ad1a
Compare
c96ad1a
to
d0430d6
Compare
helix-view/src/gutter.rs
Outdated
Box::new( | ||
move |line: usize, _selected: bool, _first_visual_line: bool, out: &mut String| { | ||
let icon = if line >= start_line && line <= start_line.saturating_add(height) { | ||
"█" |
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.
We already use the half block character for the completion popup scrollbar, so we could use the same here for consistency:
helix/helix-term/src/ui/popup.rs
Lines 277 to 281 in 15e07d4
cell = &mut surface[(inner.right() - 1, inner.top() + i as u16)]; | |
cell.set_symbol("▐"); // right half block | |
if scroll_line <= i && i < scroll_line + scroll_height { |
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.
I originally shied away from that since there's nothing stopping someone from putting the scrollbar on the left, but it looks like the diff
gutter is making a similar assumption and it looks better for it.
I'll add the change as suggested, but I'm open to discussing it if others have a different opinion.
Relates to #2210
First time contributor, so please let me know if I'm missing anything!
Overview
Architectural Changes
gutters-right
configuration option is exposed as a sibling to the existinggutters
optionView
now accepts an additionalgutters_right
parameter as aGutterConfig
objectlast_line
initialization withinrender_gutter_item
for more contextScrollbar
variant was added to theGutterType
enumDesign feedback needed
This
gutters
vs.gutters-right
implementation seemed like the easiest approach (and was also passive to the existing config file setup), but I quite like how theeditor.statusline
configuration is subdivided intoleft
,center
, andright
partitions.left
andright
partitions?