branch: master commit dfeaec0d5410a57ee5b55af5d9e1a25067bf28c3 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
swiper.el (swiper--update-input-ivy): Don't rely on window-start in terminal `window-start' and `window-end' is not reliable when in a terminal. It can be made reliable if a `redisplay' is performed, but then we get annoying blinking. So let's define `window-start' as the location of `window-height' lines above `point'. We may add a few extra overlays here and there, but the performance shouldn't suffer, since the area is roughly equal to the window size anyway. Fixes #1928 --- swiper.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/swiper.el b/swiper.el index 224d13e..5480465 100644 --- a/swiper.el +++ b/swiper.el @@ -700,8 +700,16 @@ Matched candidates should have `swiper-invocation-face'." (setq swiper--current-window-start (window-start)))) (swiper--add-overlays re - (max (window-start) swiper--point-min) - (min (window-end (selected-window) t) swiper--point-max)))))))) + (max + (if (display-graphic-p) + (window-start) + (line-beginning-position (- (window-height)))) + swiper--point-min) + (min + (if (display-graphic-p) + (window-end (selected-window) t) + (line-end-position (window-height))) + swiper--point-max)))))))) (defun swiper--add-overlays (re &optional beg end wnd) "Add overlays for RE regexp in visible part of the current buffer.