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

Smooth scrolling instead of line scrolling? #1408

Open
chriskrycho opened this issue Mar 4, 2020 · 12 comments
Open

Smooth scrolling instead of line scrolling? #1408

chriskrycho opened this issue Mar 4, 2020 · 12 comments
Labels
A-editor-component Area: Editor component/UI A-ux Area: Overall user experience and aesthetics enhancement New feature or request U-revery Upstream: Potentially dependent on changes in revery

Comments

@chriskrycho
Copy link

Currently, Oni's scrolling is line-based (as well as lacking momentum). Native-stack text editor UIs normally allow scrolling smoothly throughout the view, including such that the scroll can leave the view mid-way through lines.

  • VS Code:

    Screen Shot 2020-03-03 at 20 16 57
  • Sublime Text:

    Screen Shot 2020-03-03 at 20 16 19

I know this is not the usual for Vim, seeing as it's not the norm for terminal emulators, but I come to Oni as someone who finds terminal-driven editors off-putting but likes the idea of rich modal editing appealing.

@chriskrycho
Copy link
Author

Update: this may just be a function of how scroll amount and momentum is (not) implemented. I noted on further playing that Oni does support this, and in fact if you scroll using a trackpad or mouse it will sometimes end up on half lines:

Screen Shot 2020-03-03 at 20 19 29

…but it doesn't scroll there smoothly, and as a result it's not actually possible to scroll precisely within a document.

@glennsl glennsl added A-editor-component Area: Editor component/UI A-ux Area: Overall user experience and aesthetics enhancement New feature or request U-revery Upstream: Potentially dependent on changes in revery labels Mar 4, 2020
@glennsl
Copy link
Member

glennsl commented Mar 4, 2020

@szbergeron has been working on smooth scrolling for Revery in revery-ui/revery#766. Once that's in it should be straight forward to support here as well.

@szbergeron
Copy link

szbergeron commented Mar 4, 2020

Hi @chriskrycho, what platform are you on again? Currently I only have sdl support for smooth scrolling stood up for Wayland on Linux, but will put some more time into plumbing that out x-Plat after libscroll is integrated

@chriskrycho
Copy link
Author

Thanks for the quick response! I'm on macOS – meant to include that in the writeup last night. 🤦‍♂

@szbergeron
Copy link

@chriskrycho I don't personally have a macos machine to test on but I can try getting some experimental patches up if you're willing to test them out :)

@chriskrycho
Copy link
Author

Would be delighted to!

@szbergeron
Copy link

szbergeron commented Mar 4, 2020

Copied from discord:

if someone could try inserting prints near each of those and figuring out which actually handles both mouse wheel and touchpad pan events that would be fantastic, I should be able to mostly figure it out from there

(these are in esy-sdl2)

If you want some help setting up an env for testing any of that lemme know, should hopefully be able to figure it out from there (just interpreting NSEvents into PanEvents and bubbling them up)

@chriskrycho
Copy link
Author

I'll try to hop on Discord at some point and chat through it! I'm busy most of today and tomorrow (including the evenings) but should have some time on Friday!

@szbergeron
Copy link

Sounds good, see you there

@chriskrycho
Copy link
Author

Hasn't worked out, but will try to make this happen sometime next week.

@szbergeron
Copy link

@chriskrycho no worries, I'll be a little bit on the libscroll integration anyway so no rush from that end lol

@kolombet
Copy link

kolombet commented Dec 22, 2020

Are there any updates on this? It is the only issue that keeps me from moving from SublimeText to the Onivim. It would be amazing to have at least to have an option to configure the scroll step to make it smaller. Looks like a smooth scroll is implemented, it does not look line-based anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-editor-component Area: Editor component/UI A-ux Area: Overall user experience and aesthetics enhancement New feature or request U-revery Upstream: Potentially dependent on changes in revery
Projects
None yet
Development

No branches or pull requests

4 participants