Navigation Menu

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

Cache sometimes not cleared properly leading to wrong results [reproducable/fix] #112

Open
olejorgenb opened this issue Mar 18, 2017 · 4 comments
Labels

Comments

@olejorgenb
Copy link

Reproduce:

  • Make new file
  • Insert "foo" and save
  • Delete the line
  • M-x helm-swoop (write in something and cancel)
  • Undo
  • M-x helm-swoop (after "foo")

No results is displayed. This is due the line cache not being cleared when undoing into a state where the buffer isn't modified.

The relevant lines:

   (cond ((not (boundp 'helm-swoop-list-cache))
          (set (make-local-variable 'helm-swoop-list-cache) nil))
         ((buffer-modified-p)
          (setq helm-swoop-list-cache nil)))

Here: https://github.com/ShingoFukuyama/helm-swoop/blob/master/helm-swoop.el#L630

Might be what #106 is experiencing.

@indigoviolet
Copy link

@ShingoFukuyama -- is this fixable?

@krizex
Copy link

krizex commented Nov 8, 2017

I have the same issue.

@CeleritasCelery
Copy link
Contributor

This can be fixed by adding an advice around your undo function. I was trying to find a universal solution to this but I can't seem to find an undo primitive to use (for example undo-tree implements it's own functions).

(advice-add 'undo :after (lambda (&rest _) (helm-swoop--clear-cache)))

@troglotit
Copy link

I catch this quite frequently, most of the times when files changes on disk, for example when I checkout - Emacs changes the buffer, but cache persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants