]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper--multi-candidates): Add check
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 21 Apr 2016 14:41:55 +0000 (16:41 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 21 Apr 2016 14:41:55 +0000 (16:41 +0200)
Avoid calling `make-string' with a negative number.

Fixes #481

swiper.el

index 349c3d4c158c7facf4a83b9ae6d02064fd830829..2d4da5e95cdd4d1abbdf1d23bc9f70bc11ebc1b7 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -677,7 +677,8 @@ Run `swiper' for those buffers."
                      (1- len) len 'display
                      (concat
                       (make-string
-                       (- ww (string-width s) (length (buffer-name)) 3)
+                       (max 0
+                            (- ww (string-width s) (length (buffer-name)) 3))
                        ?\ )
                       (buffer-name))
                      s)