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

swiper-query-replace: unable to replace first match in buffer #144

Closed
zhaojiangbin opened this issue Jun 16, 2015 · 1 comment
Closed

swiper-query-replace: unable to replace first match in buffer #144

zhaojiangbin opened this issue Jun 16, 2015 · 1 comment

Comments

@zhaojiangbin
Copy link

To reproduce:

  1. In scratch buffer, enter a few lines of text containing a same word, say "foo".
  2. Call swiper, input "foo" as pattern. Press C-M-< to select the first match.
  3. Press M-q for query-replace.
  4. Enter "bar" as replacement.
  5. Hit RET. Notice the cursor moves to the second match and query-replace starts there, ignoring the first match.

It appears to be caused by that ivy places the cursor at the end of current match in buffer. When query-replace starts, it can only "look forward" for the match to replace. This has the consequence that swiper-query-replace is never able to replace the first match (or the only match) in buffer.

Verified with MELPA version 20150610.638 in Emacs 24.5.

@zhaojiangbin zhaojiangbin changed the title swiper-query-replace: always starts replacing with the next match swiper-query-replace: unable to replace first match in buffer Jun 16, 2015
@abo-abo
Copy link
Owner

abo-abo commented Jun 16, 2015

Thanks.

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

2 participants