branch: master
commit 722250c16504eeefab673e4f5aa442594b2a4a08
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-imenu-action): Handle nil case
In case there is no match, and :update-fn is 'auto, it will call the
action with nil.
The action is called with nil, so that functions like
`swiper-isearch-action` can clean up.
Re #2188
---
counsel.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/counsel.el b/counsel.el
index 48b1214..84e83bb 100644
--- a/counsel.el
+++ b/counsel.el
@@ -4324,8 +4324,9 @@ PREFIX is used to create the key."
`(("Functions" ,@fns)))
items)))
-(defun counsel-imenu-action (candidate)
- (goto-char (cdr candidate)))
+(defun counsel-imenu-action (x)
+ (when x
+ (goto-char (cdr x))))
;;;###autoload
(defun counsel-imenu ()