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

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

[elpa] master 3d0fcb5 064/184: ivy.el (ivy-partial): Fix trailing space


From: Oleh Krehel
Subject: [elpa] master 3d0fcb5 064/184: ivy.el (ivy-partial): Fix trailing space issue
Date: Wed, 16 Oct 2019 13:14:49 -0400 (EDT)

branch: master
commit 3d0fcb59fc20cc94ae29f86d137651dddd55b0ca
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-partial): Fix trailing space issue
    
    When `ivy-text' was "foo bar ", `parts' becomes '("foo" "bar"), and
    `new' becomes "bar ", which is different from the last element of
    `parts'. This is now detected.
    
    Fixes #2103
---
 ivy.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index e8a41cd..e6a158b 100644
--- a/ivy.el
+++ b/ivy.el
@@ -43,6 +43,7 @@
 (require 'ivy-overlay)
 (require 'colir)
 (require 'ring)
+(require 'subr-x)
 
 ;;* Customization
 (defgroup ivy nil
@@ -1120,7 +1121,7 @@ If the text hasn't changed as a result, forward to 
`ivy-alt-done'."
                                         ivy--old-cands)))))
     (cond ((eq new t) nil)
           ((string= new ivy-text) nil)
-          ((string= (car tail) new) nil)
+          ((string= (car tail) (string-trim-right new)) nil)
           (new
            (delete-region (minibuffer-prompt-end) (point-max))
            (setcar tail



reply via email to

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