[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 7856d51436b: Fix horizontal scrolling of images with C-f
From: |
Eli Zaretskii |
Subject: |
emacs-29 7856d51436b: Fix horizontal scrolling of images with C-f |
Date: |
Wed, 16 Aug 2023 13:42:59 -0400 (EDT) |
branch: emacs-29
commit 7856d51436b759aa03ac2b32126d177cebbbca8c
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix horizontal scrolling of images with C-f
* lisp/image-mode.el (image-forward-hscroll): Calculate the
window-width more accurately, as the number of full columns that
fits in the window's text-area. (Bug#65187)
---
lisp/image-mode.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 1820defa195..336d89dd52d 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -248,8 +248,9 @@ Stop if the right edge of the image is reached."
(image-set-window-hscroll (max 0 (+ (window-hscroll) n))))
(t
(let* ((image (image-get-display-property))
- (edges (window-inside-edges))
- (win-width (- (nth 2 edges) (nth 0 edges)))
+ (edges (window-edges nil t nil t))
+ (win-width (- (/ (nth 2 edges) (frame-char-width))
+ (/ (nth 0 edges) (frame-char-width))))
(img-width (ceiling (car (image-display-size image)))))
(image-set-window-hscroll (min (max 0 (- img-width win-width))
(+ n (window-hscroll))))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 7856d51436b: Fix horizontal scrolling of images with C-f,
Eli Zaretskii <=