* lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to-width.

`substring' does not account for full width characters.
This commit is contained in:
Mark Oteiza
2015-10-10 22:43:44 -04:00
parent 0d9c67236c
commit 3f828dc76b

View File

@@ -1501,7 +1501,7 @@ If CHARSET is nil then use UTF-8."
(setq start (point)
title (plist-get bookmark :title))
(when (> (length title) width)
(setq title (substring title 0 width)))
(setq title (truncate-string-to-width title width)))
(insert (format format title (plist-get bookmark :url)) "\n")
(put-text-property start (1+ start) 'eww-bookmark bookmark))
(goto-char (point-min))))