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

* ivy.el (ivy--find-file-action): Fix for virtual buffers #2111

Conversation

DamienCassou
Copy link
Contributor

No description provided.

@abo-abo abo-abo closed this in 09b9508 Jun 27, 2019
@abo-abo
Copy link
Owner

abo-abo commented Jun 27, 2019

Thanks. I added a fix on top of your code, (file-name-directory (cdr virtual)) should be used. Please review.

@DamienCassou
Copy link
Contributor Author

(file-name-directory (cdr virtual)) should be used.

thanks for telling me. In this case, I think we should also fix counsel-open-buffer-file-externally (which I sent a few days ago):

(defun counsel-open-buffer-file-externally (buffer)
  "Open the file associated with BUFFER with an external program."
  (when (zerop (length buffer))
    (user-error "Can't open that"))
  (let* ((virtual (assoc buffer ivy--virtual-buffers))
         (filename (if virtual
                       buffer
                     (buffer-file-name (get-buffer buffer)))))
    (unless filename
      (user-error "Can't open `%s' externally" buffer))
    (counsel-locate-action-extern (expand-file-name filename))))

If you agree I will send a PR.

@DamienCassou DamienCassou deleted the fix-find-file-from-switch-buffer branch June 28, 2019 08:56
@abo-abo
Copy link
Owner

abo-abo commented Jun 28, 2019

Agreed, please PR.

DamienCassou added a commit to DamienCassou/swiper that referenced this pull request Jun 29, 2019
According to abo-abo#2111, it's better to use `(cdr virtual)` than `buffer`.
abo-abo pushed a commit that referenced this pull request Jun 29, 2019
According to #2111, it's better to use `(cdr virtual)` than `buffer`.

Fixes #2115
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
According to abo-abo#2111, it's better to use `(cdr virtual)` than `buffer`.

Fixes abo-abo#2115
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

Successfully merging this pull request may close these issues.

2 participants