]> git.eshelyaron.com Git - emacs.git/commitdiff
Inhibit image-mode resizing in the minibuffer
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 16 Sep 2022 11:18:16 +0000 (13:18 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 16 Sep 2022 11:18:53 +0000 (13:18 +0200)
* lisp/image-mode.el (image-fit-to-window): Don't resize when in
the minibuffer (bug#57823).

lisp/image-mode.el

index bc0f7ccb0483823d2d3ac727fb835e96ae863150..0f1c4901591b1cf08f3bd517171982a10b97e509 100644 (file)
@@ -1058,7 +1058,11 @@ Otherwise, display the image by calling `image-mode'."
 
 (defun image-fit-to-window (window)
   "Adjust size of image to display it exactly in WINDOW boundaries."
-  (when (window-live-p window)
+  (when (and (window-live-p window)
+             ;; Don't resize anything if we're in the minibuffer
+             ;; (which may transitively change the window sizes if you
+             ;; hit TAB, for instance).
+             (not (minibuffer-window-active-p (selected-window))))
     (with-current-buffer (window-buffer window)
       (when (derived-mode-p 'image-mode)
         (let ((spec (image-get-display-property)))