branch: master
commit 3d0fcb59fc20cc94ae29f86d137651dddd55b0ca
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
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