branch: master
commit 9515770a534d8ef84e3647a213e5df39525c41c0
Author: braham <[email protected]>
Commit: braham <[email protected]>

    counsel.el (counsel-yank-pop): ignore entirely empty candidates
    
    * whose most noticeable effect -- when present in `kill-ring' and
      not ignored here -- is their preselection upon every new call to
      `counsel-yank-pop' (since they exactly match an empty initial
      input); empty initial input could perhaps be special-cased w/r/t
      preselection, but, regardless:
    
    * pasting an entirely empty string is a no-op, so `counsel-yank-pop'
      should likely exclude such candidates (are entirely empty strings
      ever useful ivy candidates?)
---
 counsel.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index ba79dcf..e29d246 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2657,7 +2657,7 @@ Additional Actions:
          (mapcar #'ivy-cleanup-string
                  (cl-remove-if
                   (lambda (s)
-                    (string-match "\\`[\n[:blank:]]+\\'" s))
+                    (string-match "\\`[\n[:blank:]]*\\'" s))
                   (delete-dups kill-ring)))))
     (let ((ivy-format-function #'counsel--yank-pop-format-function)
           (ivy-height 5))

Reply via email to