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

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

[elpa] externals/valign fcb62c4 161/198: * valign.el (valign--glyph-widt


From: Stefan Monnier
Subject: [elpa] externals/valign fcb62c4 161/198: * valign.el (valign--glyph-width-of): Fix docstring.
Date: Tue, 1 Dec 2020 18:19:39 -0500 (EST)

branch: externals/valign
commit fcb62c4db6d0456b83e845cd7e9769f29a32ec7f
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    * valign.el (valign--glyph-width-of): Fix docstring.
---
 valign.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/valign.el b/valign.el
index f8f3867..ca87c3f 100644
--- a/valign.el
+++ b/valign.el
@@ -417,10 +417,9 @@ before event, ACTION is either 'entered or 'left."
         (delete-overlay ov)))))
 
 (defun valign--glyph-width-of (string point)
-  "Return the pixel width of STRING with font at POINT."
-  (aref (aref (font-get-glyphs (font-at point) 0 (length string) string)
-              0)
-        4))
+  "Return the pixel width of STRING with font at POINT.
+STRING should have length 1."
+  (aref (aref (font-get-glyphs (font-at point) 0 1 string) 0) 4))
 
 (cl-defmethod valign--align-separator-row
   (type (style (eql single-column)) column-width-list)



reply via email to

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