summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index bc0f7ccb048..0f1c4901591 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -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)))