From 4daef0ce3d6ac4d7e3684d2ccef9a1d2356ba296 Mon Sep 17 00:00:00 2001 From: Michael Griffiths Date: Tue, 17 Feb 2015 23:49:48 +0000 Subject: [PATCH] [Fix #979] Add cider-inspect--popup-buffer for inspector --- CHANGELOG.md | 1 + cider-interaction.el | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 494faf993..3213ac422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ non-functioning `cider-test-jump` from test reports. * [#954](https://github.com/clojure-emacs/cider/issues/954): Detect properly a project's root when in buffer that's not visiting a file (e.g. a REPL buffer). * [#977](https://github.com/clojure-emacs/cider/issues/977): `cider-format-region` now respects indentation of the region start position +* [#979](https://github.com/clojure-emacs/cider/issues/979): Fixed the inspector buffer popping up needlessly. ## 0.8.2 / 2014-12-21 diff --git a/cider-interaction.el b/cider-interaction.el index a977c7799..c626caf65 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1196,13 +1196,14 @@ If major MODE is non-nil, enable it for the popup buffer." (defun cider-popup-buffer-display (buffer &optional select) "Display BUFFER. If SELECT is non-nil, select the BUFFER." - (-when-let (win (get-buffer-window buffer)) - (with-current-buffer buffer - (set-window-point win (point)))) - ;; Non nil `inhibit-same-window' ensures that current window is not covered - (if select - (pop-to-buffer buffer `(nil . ((inhibit-same-window . ,pop-up-windows)))) - (display-buffer buffer `(nil . ((inhibit-same-window . ,pop-up-windows))))) + (unless (eq buffer (current-buffer)) + (-when-let (win (get-buffer-window buffer)) + (with-current-buffer buffer + (set-window-point win (point)))) + ;; Non nil `inhibit-same-window' ensures that current window is not covered + (if select + (pop-to-buffer buffer `(nil . ((inhibit-same-window . ,pop-up-windows)))) + (display-buffer buffer `(nil . ((inhibit-same-window . ,pop-up-windows)))))) buffer) (defun cider-popup-buffer-quit (&optional kill)