From 1088078c55b650ccced95f1419b2ade90ea75d07 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Fri, 22 Apr 2016 10:31:20 +0200 Subject: [PATCH] When selecting a non-existing key in an alist, return that key * ivy.el (ivy-call): Previously, nil was returned. --- ivy.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ivy.el b/ivy.el index 8e12408f3..eee341ccf 100644 --- a/ivy.el +++ b/ivy.el @@ -893,12 +893,13 @@ Example use: (let ((action (ivy--get-action ivy-last))) (when action (let* ((collection (ivy-state-collection ivy-last)) - (x (if (and (consp collection) - (consp (car collection))) - (cdr (assoc ivy--current collection)) - (if (equal ivy--current "") - ivy-text - ivy--current)))) + (x (cond ((and (consp collection) + (consp (car collection)) + (cdr (assoc ivy--current collection)))) + ((equal ivy--current "") + ivy-text) + (t + ivy--current)))) (prog1 (funcall action x) (unless (or (eq ivy-exit 'done) (equal (selected-window) -- 2.39.2