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

Bad Flickering Scrolling Up #17

Closed
dylnmc opened this issue Jul 18, 2017 · 10 comments
Closed

Bad Flickering Scrolling Up #17

dylnmc opened this issue Jul 18, 2017 · 10 comments

Comments

@dylnmc
Copy link

dylnmc commented Jul 18, 2017

I didn't see an issue about this, and I don't know how easy it would be to fix. This is a really awesome plugin, but in rxvt-unicode, the flicking when pressing <c-b> or <c-u> makes the screen flicker every line.

This plugin works superbly in termite and works pretty well in gnome-terminal, however. It even works well in xterm. I just prefer rxvt-unicode most times.

I don't suppose there is anything you can do about this issue, but I thought I would post it.

Cheers,
dylnmc

@toejough
Copy link

toejough commented Aug 15, 2017

same problem in iterm. I've noticed that this doesn't occur for me if I have a horizontal split, even if it's small.

@yuttie
Copy link
Owner

yuttie commented Sep 3, 2017

@dylnmc Hmm, I cannot reproduce the issue...
I installed rxvt-unicode of version 9.21 on my Gentoo linux and tried , , etc.

Does flickering occur when you continuously repeat or ?
Since this plugin just repeats input of or in essence, I think flickering will occur when you hold down these keys. If you find flickering doesn't occur, then there may be some room for this plugin to improve the problem.

@yuttie
Copy link
Owner

yuttie commented Sep 3, 2017

@dylnmc @toejough Now I can reproduce the issue with Vim, but I have no problem with Neovim.
The flickering occurs not only on urxvt but also on st.

Holding down <C-y> does not make any flickering, so I will investigate this issue when I have time.

@toejough
Copy link

toejough commented Sep 8, 2017

maybe I'll finally have to update to neovim. This is by far the best scrolling plugin I've found 🥇

@dylnmc
Copy link
Author

dylnmc commented Sep 9, 2017

I was using neovim and vim for a while. Due to some complications, I have been using only vim mostly for a few months now. Although I sometimes pop in and use neovim when I am feeling spiffy, I usually stick with vim. I have found that some of the trickier things simply work in vim (but there are still a few edge cases in neovim that I can't be bothered with).

I am glad to hear that it works in neovim.

@amarqueslee
Copy link
Contributor

I’ve submitted a pull request which I believe will fix this issue. It works for me, would anyone else mind to give my patched version a shot and let me know if it works for them too?

@yuttie
Copy link
Owner

yuttie commented Oct 3, 2017

@amarqueslee Thank you for your contribution!
I tried your branch and confirmed that it solved the problem for me.

Your patch includes two major changes:

  1. Using redraw (efc7959#diff-c2074d217c7c8d15486f419d95226276R71), and
  2. Running just one persistent tick thread.

Firstly, I think this flikering issue is actually solved by the first change.
Applying only the first change, I found that flickering dissapears on my environment.
@amarqueslee, could you try it on your environment?
If it works for you and others too, I want you to create a separate pull request that just inserts redraw appropriately.
Then, I will merge the new pull request for this issue.

Secondly, we need to improve the other change for another issue of this plugin.
Thanks to your patch, I found that my original code redundantly starts a new tick thread whenever comfortable_motion#flick() is called, which causes unnatural acceleration.
The second change actually fixes the problem by maintaining only a single persistent tick thread.
However, it also introduces constant CPU usage even when a user doesn't use a vim.
I think we can improve the patch by stopping a tick thread when it is not needed.
This problem should be discussed in another issue.

@amarqueslee
Copy link
Contributor

Ok. I:

  • Confirm that this issue is resolved with a call to redraw only
  • Have updated the PR for this issue to only call redraw
  • Have created a new issue to represent the remaining work that needs to be done around fixing up tick threads
  • Will implement the changes you suggested and submit a further pull request under the separate issue

Thanks @yuttie for testing the fix and for your suggestions and feedback.

@yuttie
Copy link
Owner

yuttie commented Oct 11, 2017

I close this issue because #21 has been merged and it fixed the problem.

@yuttie yuttie closed this as completed Oct 11, 2017
@dylnmc
Copy link
Author

dylnmc commented Oct 11, 2017

Amazing! It's like an entirely different plugin now 😆

Maybe I will encorporate this into my daily workflow now 💃

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

No branches or pull requests

4 participants