branch: master
commit 7a069be4766cf54d07d176ad4133687ce230b34b
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-occur-press): Work with counsel-rhythmbox
> (cdr (assoc str coll))
Special behavior for `counsel-rhythmbox'. Maybe not taking `cdr' is the
right thing, but that's how Helm and `helm-rhythmbox-play-song' works.
---
ivy.el | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/ivy.el b/ivy.el
index 459312c..9afc0f3 100644
--- a/ivy.el
+++ b/ivy.el
@@ -627,7 +627,7 @@ If the input is empty, select the previous history element
instead."
window
(if (= (length (window-list)) 1)
(selected-window)
- (next-window )))))
+ (next-window)))))
(defun ivy--actionp (x)
"Return non-nil when X is a list of actions."
@@ -2136,11 +2136,16 @@ EVENT gives the mouse position."
(interactive)
(require 'pulse)
(let* ((ivy-last ivy-occur-last)
- (ivy-text (ivy-state-text ivy-last)))
+ (ivy-text (ivy-state-text ivy-last))
+ (str (buffer-substring
+ (+ 4 (line-beginning-position))
+ (line-end-position)))
+ (coll (ivy-state-collection ivy-last)))
(funcall ivy-occur-action
- (buffer-substring
- (+ 4 (line-beginning-position))
- (line-end-position)))
+ (if (and (consp coll)
+ (consp (car coll)))
+ (cdr (assoc str coll))
+ str))
(with-ivy-window
(pulse-momentary-highlight-one-line (point)))))