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

Error on attempt to visit file from `ivy-occur` buffer when the original buffer from where the search was invoked was killed #1834

Closed
Alexander-Shukaev opened this issue Dec 1, 2018 · 4 comments

Comments

@Alexander-Shukaev
Copy link

commented Dec 1, 2018

  1. Go to one of your projects (i.e. open some buffer, let's call it X, which has a default directory inside of a corresponding git repo).
  2. counsel-rg and search for something.
  3. Do ivy-occur.
  4. Now kill that original buffer X.
  5. Now try to visit any of the matches in the occurrence buffer:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match(".*" nil nil)
  display-buffer-assq-regexp(nil ((".*" display-buffer-same-window) (reusable-frames . t)) nil)
  display-buffer(#<killed buffer> display-buffer-pop-up-window)
  ivy--occur-press-update-window()
  ivy-occur-press()
  ivy-occur-press-and-switch()
  funcall-interactively(ivy-occur-press-and-switch)
  call-interactively(ivy-occur-press-and-switch nil nil)
  command-execute(ivy-occur-press-and-switch)

Most likely has nothing to do with counsel and is a general ivy issue.

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Dec 1, 2018

Can you please try to reword the issue title so that it conveys more information at first glance, e.g. that ivy-occur tries and fails to display a killed buffer?

@Alexander-Shukaev Alexander-Shukaev changed the title `display-buffer(#<killed buffer> display-buffer-pop-up-window)` Error on attempt to visit file from `ivy-occur` buffer when the original buffer from where the search was invoked was killed Dec 2, 2018

@mookid

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

@abo-abo @basil-conto is there anything better than improving error reporting in that case?

@Alexander-Shukaev

This comment has been minimized.

Copy link
Author

commented Dec 3, 2018

It's not about reporting. It's about

swiper/ivy.el

Lines 4251 to 4253 in 86635fb

(setf (ivy-state-window ivy-occur-last)
(display-buffer (ivy-state-buffer ivy-occur-last)
'display-buffer-pop-up-window))))))

where ivy-state-buffer somehow refers to the buffer from where the search was invoked originally (see my explanation for X) but that buffer is dead already. I have no idea why there is a need to hold on to that buffer at all.

@mookid

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2018

Indeed, I misunderstood which killed buffer complain it was.

Indeed, I don't get why the code in ivy--occur-press-update-window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.