branch: master
commit ecff1641958898dcf98b9645ecc8525a5f15e096
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    ivy.el (ivy-insert-current): Minor simplification
---
 ivy.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/ivy.el b/ivy.el
index 7da52fe..602fcf7 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4154,13 +4154,11 @@ If the region is active, forward to `kill-ring-save' 
instead."
 Don't finish completion."
   (interactive)
   (delete-minibuffer-contents)
-  (insert
-   (if (and ivy--directory
-            (ivy--dirname-p (ivy-state-current ivy-last)))
-       (substring-no-properties
-        (ivy-state-current ivy-last) 0 -1)
-     (substring-no-properties
-      (ivy-state-current ivy-last)))))
+  (let ((end (and ivy--directory
+                  (ivy--dirname-p (ivy-state-current ivy-last))
+                  -1)))
+    (insert (substring-no-properties
+             (ivy-state-current ivy-last) 0 end))))
 
 (define-obsolete-variable-alias 'ivy--preferred-re-builders
     'ivy-preferred-re-builders "0.10.0")

Reply via email to