aboutsummaryrefslogtreecommitdiff
path: root/sx-question-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r--sx-question-mode.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el
index 19930e7..f3ef8e5 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -616,15 +616,19 @@ With non-nil prefix argument NO-UPDATE, just redisplay, don't
query the api."
(interactive "P")
(sx-question-mode--ensure-mode)
- (let ((point (point)))
+ (let ((point (point))
+ (line (count-screen-lines
+ (window-start) (point))))
(sx-question-mode--erase-and-print-question
(if no-update
sx-question-mode--data
(sx-assoc-let sx-question-mode--data
(sx-question-get-question .site .question_id))))
(goto-char point)
- (when (get-buffer-window (current-buffer))
- (recenter))))
+ (when (equal (selected-window)
+ (get-buffer-window (current-buffer)))
+ (recenter line)))
+ (sx-message "Done."))
(defun sx-question-mode--ensure-mode ()
"Ensures we are in question mode, erroring otherwise."