abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.27k stars 337 forks source link

`swiper-all` doesn't revert to starting point when cancelled (`C-g`) #3023

Open gc1o1 opened 10 months ago

gc1o1 commented 10 months ago

The expected behavior

I start swiper or swiper-isearch. I go to another finding in the mini-buffer (with C-n and C-p). I don't press Enter. Instead, I decide to cancel (C-g) the search. I am sent back to the point where I was when I started swiper. That's good, it's the intended behavior. There is explicit code to do that. See variable swiper-stay-on-quit which is described as "When non-nil don't go back to search start on abort.", and it's nil, so, the default behavior is indeed to go back on abort.

The bug

However, this isn't used by swiper-all and swiper-all.
So, if you navigate around in the mini-buffer with C-n and C-p, and (before pressing Enter) you press C-g, you'll be stuck where you last navigated, as if you had pressed Enter to actually go there.