]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/icomplete.el (icomplete-completions): Use string-width.
authorJuanma Barranquero <lekktu@gmail.com>
Sun, 2 Mar 2014 00:50:07 +0000 (01:50 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Sun, 2 Mar 2014 00:50:07 +0000 (01:50 +0100)
Suggested by Stefan Monier <monnier@iro.umontreal.ca>.

lisp/ChangeLog
lisp/icomplete.el

index d25f877a644ed0efa27c9596545989cf5954ba3c..e5c44a1232a8bda77c377ae3d045ffc97586bb58 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * icomplete.el (icomplete-completions): Use string-width.
+       Suggested by Stefan Monier <monnier@iro.umontreal.ca>.
+
 2014-03-01  Dmitry Gutov  <dgutov@yandex.ru>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
index e3f7fde7797e33c7f30ec935d0cb9470423ae9dd..626d63914d8983cbf5f6dbd1be4c933419182f99 100644 (file)
@@ -403,14 +403,14 @@ matches exist."
                                 (substring most compare))
                                 ;; Don't bother truncating if it doesn't gain
                                 ;; us at least 2 columns.
-                               ((< compare (+ 2 (length ellipsis))) most)
+                               ((< compare (+ 2 (string-width ellipsis))) most)
                                (t (concat ellipsis (substring most compare))))
                               close-bracket)))
             ;;"-prospects" - more than one candidate
             (prospects-len (+ (string-width
                                (or determ (concat open-bracket close-bracket)))
                               (string-width icomplete-separator)
-                              (+ 2 (length ellipsis)) ;; take {…} into account
+                              (+ 2 (string-width ellipsis)) ;; take {…} into account
                               (string-width (buffer-string))))
              (prospects-max
               ;; Max total length to use, including the minibuffer content.