diff options
author | Sean Allred <code@seanallred.com> | 2014-11-27 11:21:02 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-27 11:21:02 -0500 |
commit | 92ec323425057284de93c90b7ae0e8f5e96611b6 (patch) | |
tree | 65112f05a72c0ba4ac74076d1c53f6612deeb1cd /sx-question-mode.el | |
parent | 9c2df708ac4dc62c34882b7978761cf1f73e063f (diff) | |
parent | 6848008b60938100d04cda96c093a24cb3370f9a (diff) |
Merge branch 'master' into issue-100
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r-- | sx-question-mode.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el index bc7c62c..a58bc43 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -602,15 +602,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." |