From c7cb481e1ba3947931d28a4585624ea35fe76721 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 26 Nov 2014 00:04:08 +0000 Subject: Old recentering bug We sometimes get an error because we're recentering a window that's not selected. --- sx-question-mode.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sx-question-mode.el') 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. -- cgit v1.2.3 From 977182943de4e3824a9178f3f3c114648b227265 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 26 Nov 2014 00:55:49 +0000 Subject: Add keybind for commenting. --- sx-question-mode.el | 1 + 1 file changed, 1 insertion(+) (limited to 'sx-question-mode.el') diff --git a/sx-question-mode.el b/sx-question-mode.el index 06413f2..70b8866 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -572,6 +572,7 @@ Letters do not insert themselves; instead, they are commands. `(("n" sx-question-mode-next-section) ("p" sx-question-mode-previous-section) ("g" sx-question-mode-refresh) + ("c" sx-comment) ("v" sx-visit) ("u" sx-toggle-upvote) ("d" sx-toggle-downvote) -- cgit v1.2.3