Browse Source

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.
TEC 4 years ago
parent
commit
55cf527375
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org.el

+ 1 - 1
lisp/org.el

@@ -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)