org: Image display, account for line number width

* lisp/org.el (org-display-inline-image--width): To be slightly more
accurate when calculating image widths that are proportional to the text
width in the current buffer, subtract the width taken up by line numbers.
This commit is contained in:
TEC 2021-09-29 21:38:50 +08:00
parent 73875939a8
commit 55cf527375
Signed by: tec
GPG key ID: 779591AFDB81F06C

View file

@ -16679,7 +16679,7 @@ buffer boundaries with possible narrowing."
(/ (or (and (bound-and-true-p visual-fill-column-mode)
(or visual-fill-column-width auto-fill-function))
(when auto-fill-function fill-column)
(window-text-width))
(- (window-text-width) display-line-numbers-width))
(float (window-total-width)))))
width)))
((numberp org-image-actual-width)