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

Screen flash with swiper #1921

Closed
Ergus opened this issue Feb 4, 2019 · 4 comments
Closed

Screen flash with swiper #1921

Ergus opened this issue Feb 4, 2019 · 4 comments

Comments

@Ergus
Copy link
Contributor

@Ergus Ergus commented Feb 4, 2019

Hi:
I use emacs in xterm and I have notice a small flash (the screen turns black during some miliseconds) when using swiper and the result candidate is out of the visible part of the buffer (even just one line out).
I tried different terminals (alcritty, urxvt, terminology) and it looks that the problem persists also there.
When using graphical emacs there is not flash at all, so I thought it was related wit the terminal refresh/redraw time, but when I try using isearch I can't observe any flash at all, even when a big scroll is needed to go to the next candidate (so, if it happens maybe it is at least one order of magnitude faster).
When I try native commands like goto-line, exchange-point-and-mark there is not flash at all.
I also tried using a clean emacs with just ivy (the make plain adding: emacs -nw -Q $(LOAD) -l targets/plain.el in the Makefile) and the problem is also there.
Maybe it is not directly an ivy issue, but after a couple of hours the flashes starts becoming annoying. Any idea where the problem comes from?

@abo-abo abo-abo closed this in 98b70a7 Feb 4, 2019
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Feb 4, 2019

Thanks, please test.

You could still say it's an Emacs issue, since simply calling recenter results in a blink. But now we don't call it any more for emacs -nw.

@Ergus
Copy link
Contributor Author

@Ergus Ergus commented Feb 4, 2019

Very thanks it is perfect now!! You're amazing!!

@Ergus
Copy link
Contributor Author

@Ergus Ergus commented Feb 4, 2019

BTW: There is a pull request in emacs 27 related to this. So the recenter function will have an argument to control the redisplay behaviour. bug#31325.

@Ergus
Copy link
Contributor Author

@Ergus Ergus commented May 10, 2019

Hi abo-abo:

I have learner a bit more of emacs after this issue and I found that for this should be better to extend the conditions you added to test also the variable recenter-redisplay to be nil (or not tty). So recenter can be called in those cases without the splash.

Reason:
When not recentering, ivy-alt-done moves the candidate line in the main screen before exiting (sometimes from top to bottom) and that's as also very annoying. But also the screen splash I observed was because recenter-redisplay was tty. Setting it no nil the splash disappear, but the default value is tty .

(when (and (or (display-graphic-p)
                         (not (equal recenter-redisplay 'tty)))
                    (or
                         (< (point) (window-start))
                         (> (point) (window-end (ivy-state-window ivy-last) t))))
                  (recenter))

And in a similar way for the changes in commit related with #1923 and #1928 could improve the user experience a bit more.

I don't know if it is better to do this or report the other behaviour (candidate line move on ivy-alt-done) as an issue?

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants