branch: externals/company
commit cc52e4b919154ae7876afd5f02f46101c0b9c9d3
Author: Dmitry Gutov <dmi...@gutov.dev>
Commit: Dmitry Gutov <dmi...@gutov.dev>

    Fix scrolling of doc buffer when company-auto-update-doc is used
    
    Fixes #1409
---
 company.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index 5d732e214c..fe22225ead 100644
--- a/company.el
+++ b/company.el
@@ -2231,7 +2231,8 @@ For more details see `company-insertion-on-trigger' and
                 (company-call-frontends 'post-command)
                 (when company-auto-update-doc
                   (condition-case nil
-                      (company-show-doc-buffer)
+                      (unless (company--electric-command-p)
+                        (company-show-doc-buffer))
                     (user-error nil)
                     (quit nil))))
             (let ((delay (company--idle-delay)))
@@ -2836,10 +2837,13 @@ from the candidates list.")
   '(scroll-other-window scroll-other-window-down mwheel-scroll)
   "List of Commands that won't break out of electric commands.")
 
+(defun company--electric-command-p ()
+  (memq this-command company--electric-commands))
+
 (defun company--electric-restore-window-configuration ()
   "Restore window configuration (after electric commands)."
   (when (and company--electric-saved-window-configuration
-             (not (memq this-command company--electric-commands)))
+             (not (company--electric-command-p)))
     (set-window-configuration company--electric-saved-window-configuration)
     (setq company--electric-saved-window-configuration nil)))
 

Reply via email to