From 28e21352ec0d083c13ffe5484f41c3d2d10d29ac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 21 Jul 2018 01:20:59 +0200 Subject: [PATCH] Have popup manager handle treemacs windows Other windows would be resized slightly incorrectly because treemacs opens as a fixed split, rather than a side window. This change forces it to be a side window, which resolves the problem _and_ restores the functionality of balance-windows, which is disabled when a fixed split is present. --- modules/ui/popup/+hacks.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index b8d1a4333..8f43afd73 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -282,6 +282,14 @@ instead of switch-to-buffer-*." (set-popup-rule! "\\(^\\*Contents\\|'s annots\\*$\\)" :ignore t)) +;; `treemacs' +(after! treemacs + (set-popup-rule! "^ \\*Treemacs" :side 'left :size treemacs-width :quit nil) + (defun +popup*set-popup (&rest _) + (+popup--init (selected-window))) + (advice-add #'treemacs--setup-buffer :after #'+popup*set-popup)) + + ;; `wgrep' (progn ;; close the popup after you're done with a wgrep buffer