From 3dcc423308ef2b80252088f3b4f3ff408f87a75a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 11 May 2017 09:48:12 +0200 Subject: [PATCH] Refactor doom/window-zoom Inspired by gilbertw1/bmacs's +gdoom/toggle-maximize-buffer --- core/autoload/ui.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/autoload/ui.el b/core/autoload/ui.el index 52cbed848..7d45e8f3f 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -29,12 +29,8 @@ "Maximize and isolate the current buffer. Activate again to undo this. If the window changes before then, the undo expires." (interactive) - (unless (one-window-p) - (setq doom-window-zoomed nil)) - (if doom-window-zoomed - (progn - (set-window-configuration doom-window-zoomed) - (setq doom-window-zoomed nil)) - (unless (one-window-p t) - (setq doom-window-zoomed (current-window-configuration)) - (delete-other-windows)))) + (if (and (one-window-p) + (assoc ?_ register-alist)) + (jump-to-register ?_) + (window-configuration-to-register ?_) + (delete-other-windows)))