emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 560957f 074/184: Check if ivy--done is accepting a string.


From: Oleh Krehel
Subject: [elpa] master 560957f 074/184: Check if ivy--done is accepting a string.
Date: Wed, 16 Oct 2019 13:14:51 -0400 (EDT)

branch: master
commit 560957f571c3c0685948b2aeb8bbaad4a4a47c6b
Author: Amos Bird <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Check if ivy--done is accepting a string.
    
    Some ivy commands (e.g. swiper-isearch) provide an int instead of a
    string. It won't work when the integer value is larger than unicode
    which cannot be converted to a char.
    
    ```
    Debugger entered--Lisp error: (wrong-type-argument char-or-string-p 5557661)
      ivy--done(5557661)
      ivy-done()
      funcall-interactively(ivy-done)
      call-interactively(ivy-done nil nil)
      command-execute(ivy-done)
      read-from-minibuffer(...)
      ivy-read(...)
      swiper-isearch()
    ```
    
    Fixes #2200
---
 ivy.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/ivy.el b/ivy.el
index 7fb4e9d..5307cab 100644
--- a/ivy.el
+++ b/ivy.el
@@ -746,12 +746,13 @@ N is obtained from `ivy-more-chars-alist'."
   "Insert TEXT and exit minibuffer."
   (if (member (ivy-state-prompt ivy-last) '("Create directory: " "Make 
directory: "))
       (ivy-immediate-done)
-    (insert
-     (setf (ivy-state-current ivy-last)
-           (if (and ivy--directory
-                    (not (eq (ivy-state-history ivy-last) 
'grep-files-history)))
-               (expand-file-name text ivy--directory)
-             text)))
+    (if (stringp text)
+        (insert
+         (setf (ivy-state-current ivy-last)
+               (if (and ivy--directory
+                        (not (eq (ivy-state-history ivy-last) 
'grep-files-history)))
+                   (expand-file-name text ivy--directory)
+                 text))))
     (setq ivy-exit 'done)
     (exit-minibuffer)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]