diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-26 00:04:08 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-26 00:06:23 +0000 |
commit | c7cb481e1ba3947931d28a4585624ea35fe76721 (patch) | |
tree | 5b90faba181d5c64ea412a4786eabffb86693583 /sx-question-mode.el | |
parent | cbac35d3cb4d8da99034806e22518f023b4883ff (diff) |
Old recentering bug
We sometimes get an error because we're recentering a window that's not
selected.
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r-- | sx-question-mode.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el index 8ccc576..dda65ab 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -469,11 +469,12 @@ Prefix argument N moves N sections down or up." (unless (and (overlayp ov) (overlay-get ov 'invisible)) (cl-decf count))))) - (when sx-question-mode-recenter-line - (let ((ov (car-safe (sx-question-mode--section-overlays-at (line-end-position))))) - (when (and (overlayp ov) (> (overlay-end ov) (window-end))) - (recenter sx-question-mode-recenter-line)))) - (sx-message-help-echo)) + (when (equal (selected-window) (get-buffer-window)) + (when sx-question-mode-recenter-line + (let ((ov (car-safe (sx-question-mode--section-overlays-at (line-end-position))))) + (when (and (overlayp ov) (> (overlay-end ov) (window-end))) + (recenter sx-question-mode-recenter-line)))) + (sx-message-help-echo))) (defun sx-question-mode-previous-section (&optional n) "Move down to previous section (question or answer) of this buffer. |