diff options
-rw-r--r-- | sx-question-list.el | 3 | ||||
-rw-r--r-- | sx-question-mode.el | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sx-question-list.el b/sx-question-list.el index ef5d3f5..8c558e6 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -279,7 +279,8 @@ focus the relevant window." (when (sx-question--read-p data) (cl-decf sx-question-list--unread-count) (sx-question--mark-read data)) - (unless (window-live-p sx-question-mode--window) + (unless (and (window-live-p sx-question-mode--window) + (null (equal sx-question-mode--window (selected-window)))) (setq sx-question-mode--window (condition-case er (split-window-below sx-question-list-height) diff --git a/sx-question-mode.el b/sx-question-mode.el index 199e082..686d357 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -184,7 +184,8 @@ QUESTION must be a data structure returned by `json-read'." (sx-assoc-let question (mapc #'sx-question-mode--print-section .answers)) (goto-char (point-min)) - (sx-question-mode-next-section)) + (with-selected-window sx-question-mode--window + (sx-question-mode-next-section))) (defun sx-question-mode--print-section (data) "Print a section corresponding to DATA. |