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

Right align scrollbar with track in completion popup #2754

Conversation

sudormrfbin
Copy link
Member

@sudormrfbin sudormrfbin commented Jun 11, 2022

Depends on #2728.


  • Align the scollbar to the right edge of the popup rather than at a margin of one.
  • Add a scrollbar track and a new scope ui.menu.scroll.
Before After
before after

A multiline scrollbar like the one mentioned in #2728 (comment) would be nicer though:

multiline scrollbar

@archseer
Copy link
Member

Changes the scrollbar block character to be thicker.

I preferred the thinner one! But rendering block chars seems to vary a lot by terminal

@sudormrfbin
Copy link
Member Author

sudormrfbin commented Jun 12, 2022

I was experimenting with adding a scroll background, and it looked better with a thicker bar. We can't style cells partially with another color, hence if a half block is used the selection style will look cut off:

Thin half bar Thick full bar
halfbar fullbar

The thin bar looks much better but the gap is nagging. Is the background something that we even want? If so which type of block character? Keeping it simple with a thin block (like earlier) is also easier to do.

@CptPotato
Copy link
Contributor

The thin bar looks much better but the gap is nagging.

Isn't it possible to use the foreground and background colors of the half-block to fill the gap with the selection color? Or is the background color dictated by the window?

@sudormrfbin
Copy link
Member Author

sudormrfbin commented Jun 22, 2022

Got the thin block working without the annoying gap, thanks @CptPotato for the pointer!

completion-popup-thin-scroll

A new scope ui.menu.scroll controls the colors of the the scrollbar thumb and the track.


Note: The PR now depends on #2728.

@sudormrfbin sudormrfbin force-pushed the completion-popup-scroll-bar-right-align branch from ed3ecd0 to 60779ab Compare June 22, 2022 16:27
@sudormrfbin sudormrfbin changed the title Right align thicker scrollbar in completion popup Right align scrollbar with track in completion popup Jun 22, 2022
@CptPotato
Copy link
Contributor

Looks very clean, I like it!

@archseer
Copy link
Member

Oh yeah the alignment was an off-by-1 error for sure 😆

@archseer
Copy link
Member

Can you rebase?

- Align the scollbar to the right edge of the popup rather than at
  a margin of one.
- Add a scrollbar track and a new scope `ui.menu.scroll`.
@sudormrfbin sudormrfbin force-pushed the completion-popup-scroll-bar-right-align branch from 60779ab to 9eed490 Compare June 26, 2022 17:37
@sudormrfbin
Copy link
Member Author

Rebased!

@archseer archseer merged commit a26943d into helix-editor:master Jun 27, 2022
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.

4 participants