From db9106f92cf71e6878b08650c45cfe89455f4959 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 20 Oct 2021 21:42:13 +0200 Subject: [PATCH] fix(popup,undo): show undo-tree visualizer in popup But only if undo-tree-visualizer-diff is disabled. If it's enabled, undo-tree has its own opinions on how to manage the two windows which don't mesh well with our popup manager, so we leave undo-tree to its devices. Fix: #5617 --- modules/ui/popup/+hacks.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index 2140ed708..3819355c4 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -358,6 +358,15 @@ Ugh, such an ugly hack." (funcall fn function))) +;;;###package undo-tree +(defadvice! +popup--use-popup-window-for-undo-tree-visualizer-a (fn &rest args) + "TODO" + :around #'undo-tree-visualize + (if undo-tree-visualizer-diff + (apply fn args) + (letf! ((#'switch-to-buffer-other-window #'pop-to-buffer)) + (apply fn args)))) + ;;;###package wgrep (progn ;; close the popup after you're done with a wgrep buffer