Remove core-popup coupling

New popup management system coming soon!
This commit is contained in:
Henrik Lissner 2018-01-03 03:44:32 -05:00
parent e0c8e6daef
commit 8e7b822062
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 11 additions and 14 deletions

View file

@ -105,9 +105,7 @@ If DERIVED-P, test with `derived-mode-p', otherwise use `eq'."
;;;###autoload ;;;###autoload
(defun doom-visible-windows (&optional window-list) (defun doom-visible-windows (&optional window-list)
"Return a list of the visible, non-popup windows." "Return a list of the visible, non-popup windows."
(cl-loop for win in (or window-list (window-list)) (cl-remove-if #'window-at-side-p (or window-list (window-list))))
unless (doom-popup-p win)
collect win))
;;;###autoload ;;;###autoload
(defun doom-visible-buffers (&optional buffer-list) (defun doom-visible-buffers (&optional buffer-list)

View file

@ -405,16 +405,15 @@ end of the workspace list."
"Close the selected window. If it's the last window in the workspace, close "Close the selected window. If it's the last window in the workspace, close
the workspace and move to the next." the workspace and move to the next."
(interactive) (interactive)
(if (doom-popup-p) (let ((delete-window-fn (if (featurep 'evil) #'evil-window-delete #'delete-window)))
(doom/popup-close) (if (window-at-side-p)
(funcall delete-window-fn)
(let ((current-persp-name (+workspace-current-name))) (let ((current-persp-name (+workspace-current-name)))
(cond ((or (+workspace--protected-p current-persp-name) (cond ((or (+workspace--protected-p current-persp-name)
(> (length (doom-visible-windows)) 1)) (cdr (doom-visible-windows)))
(if (bound-and-true-p evil-mode) (funcall delete-window-fn))
(evil-window-delete) ((cdr (+workspace-list-names))
(delete-window))) (+workspace/delete current-persp-name)))))))
((> (length (+workspace-list-names)) 1)
(+workspace/delete current-persp-name))))))
;;;###autoload ;;;###autoload
(defun +workspace/close-workspace-or-frame () (defun +workspace/close-workspace-or-frame ()

View file

@ -30,6 +30,6 @@ to a pop up buffer."
(setq lines (count-lines (point-min) (point-max))) (setq lines (count-lines (point-min) (point-max)))
(goto-char (point-min)) (goto-char (point-min))
(if (> lines 1) (if (> lines 1)
(doom-popup-buffer buf) (pop-to-buffer buf t)
(message "%s" (buffer-substring (point-min) (point-max))) (message "%s" (buffer-substring (point-min) (point-max)))
(kill-buffer buf))))) (kill-buffer buf)))))