From d56ddaa1671d19350765824b4f480db6c8aa84ca Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 24 Feb 2015 21:52:30 +0200 Subject: [PATCH 1/1] Allow scrolling the doc window with the mouse wheel Resolves #309 --- NEWS.md | 1 + company.el | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index c8dd158eb..d4b767dd7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ## Next +* The documentation buffer window can be scrolled with the mouse wheel. * New command `company-diag`. Use it in bug reports. ## 2015-02-02 (0.8.10) diff --git a/company.el b/company.el index a594f70de..eae36ef6f 100644 --- a/company.el +++ b/company.el @@ -2015,7 +2015,7 @@ character, stripping the modifiers. That character must be a digit." (current-buffer))) (defvar company--electric-commands - '(scroll-other-window scroll-other-window-down) + '(scroll-other-window scroll-other-window-down mwheel-scroll) "List of Commands that won't break out of electric commands.") (defmacro company--electric-do (&rest body) @@ -2029,9 +2029,12 @@ character, stripping the modifiers. That character must be a digit." (and (< (window-height) height) (< (- (window-height) row 2) company-tooltip-limit) (recenter (- (window-height) row 2))) - (while (memq (setq cmd (key-binding (vector (list (read-event))))) + (while (memq (setq cmd (key-binding (read-key-sequence-vector nil))) company--electric-commands) - (call-interactively cmd)) + (condition-case err + (call-interactively cmd) + ((beginning-of-buffer end-of-buffer) + (message (error-message-string err))))) (company--unread-last-input))))) (defun company--unread-last-input () -- 2.39.2