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

anzu-query-replace: counter can be wrong when using suggested query/replace criteria #109

Open
gonewest818 opened this issue Mar 31, 2020 · 0 comments
Labels
bug a feature isn't working

Comments

@gonewest818
Copy link
Collaborator

gonewest818 commented Mar 31, 2020

As reported in #93.

With case-fold-search set to t in a buffer containing:

Gee AB ab AB ab AB ab.

Do, in sequence,

  1. anzu-query-replace e RET RET -- the counter is (1/2) -- quit and go back at the bol (C-a), then
  2. anzu-query-replace ab RET RET -- the counter is (1/6) -- C-a, then
  3. anzu-query-replace RET (accepting the proposed replacement ab → ); the counter wrongly shows (1/2).

This last bug has proved rather hard to reproduce consistently. If I run all the other tests, including those with case-fold-search set to nil, then set case-fold-search to t again and run this one, at point 3 the counter becomes (1/6) instead of (1/2). If you can't reproduce point 3, do another replacement of "e", quit and do an additional one using the suggested replacement, I get (1/6) instead of (1/2) sometimes. The heart of the matter is that sometimes Anzu appears to use the previous replacement's count when performing another one using the suggested completion.

Additionally, with case-fold-search set to nil in the same buffer:

  1. anzu-query-replace "ab" with "cd": offers to replace each "ab" with "cd" , counts correctly to 3 matches; HOWEVER a second anzu-query-replace and accepting the default criteria (ab → cd) results in an incorrect count of 6 matches.

  2. anzu-query-replace "AB" with "CD": offers to replace each "AB" with "CD", counts correctly to 3 matches; again repeating the same query replace with default arguments results in an incorrect count of 6 matches.

@gonewest818 gonewest818 added the bug a feature isn't working label Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a feature isn't working
Development

No branches or pull requests

1 participant