From 3deeb40e4a3c8cbbc6778749845ee37e608ba3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 30 Aug 2022 11:04:49 +0200 Subject: eb.el: Fix fleeting window size. --- eb.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'eb.el') diff --git a/eb.el b/eb.el index 7ca810a..c79c369 100644 --- a/eb.el +++ b/eb.el @@ -38,13 +38,15 @@ (eb--fleeting-minor-mode -1) (quit-window)) (display-buffer-in-direction buffer '((direction . ,dir))) - (select-window (get-buffer-window buffer)) - (with-current-buffer buffer - (setq default-directory cwd) - ,@body - (eb--fleeting-minor-mode) - (setq eb--fleeting--direction ',dir)) - (get-buffer-window buffer))))) + (let ((window (get-buffer-window buffer))) + (select-window window) + (with-current-buffer buffer + (setq default-directory cwd) + ,@body + (eb--fleeting-minor-mode) + (setq eb--fleeting--direction ',dir)) + (run-with-idle-timer 0 nil (lambda (window) (fit-window-to-buffer window)) window) + window))))) (defvar eb--fleeting--buffer nil) (defvar eb--fleeting--window nil) -- cgit v1.2.3