branch: externals/valign
commit fcb62c4db6d0456b83e845cd7e9769f29a32ec7f
Author: Yuan Fu <[email protected]>
Commit: Yuan Fu <[email protected]>

    * 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