org-string-width: Do not remove face info when PIXELS is non-nil
* lisp/org-macs.el (org-string-width): Do not remove the STRING faces unless character width is requested. Faces might alter pixel width of the string and removing them would yield incorrect results.
This commit is contained in:
parent
9bc6c363da
commit
312f39a05d
|
@ -968,12 +968,15 @@ Return width in pixels when PIXELS is non-nil."
|
|||
(org--string-width-1 string)
|
||||
;; Wrap/line prefix will make `window-text-pizel-size' return too
|
||||
;; large value including the prefix.
|
||||
(remove-text-properties 0 (length string)
|
||||
'(wrap-prefix t line-prefix t)
|
||||
string)
|
||||
;; Face should be removed to make sure that all the string symbols
|
||||
;; are using default face with constant width. Constant char width
|
||||
;; is critical to get right string width from pixel width.
|
||||
(remove-text-properties 0 (length string)
|
||||
'(wrap-prefix t line-prefix t face t)
|
||||
string)
|
||||
;; is critical to get right string width from pixel width (not needed
|
||||
;; when PIXELS are requested though).
|
||||
(unless pixels
|
||||
(remove-text-properties 0 (length string) '(face t) string))
|
||||
(let (;; We need to remove the folds to make sure that folded table
|
||||
;; alignment is not messed up.
|
||||
(current-invisibility-spec
|
||||
|
|
Loading…
Reference in New Issue