emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 3d4e87c 11/31: company: company--company-command-p: Fix lo


From: Dmitry Gutov
Subject: [elpa] master 3d4e87c 11/31: company: company--company-command-p: Fix lookup-key
Date: Sun, 14 Apr 2019 22:06:16 -0400 (EDT)

branch: master
commit 3d4e87cf610c0e48ef219fa87c417af4ee8e056b
Author: Nikita Leshenko <address@hidden>
Commit: Nikita Leshenko <address@hidden>

    company: company--company-command-p: Fix lookup-key
    
    Make sure it returns an actual command.
    
    `lookup-key' returns a number when the key sequence is longer than 1 but it
    isn't a valid sequence of prefix characters. The number evaluates to true 
but
    the key isn't in the keymap.
    
    When that happens the completion gets lost. To reproduce, complete a 
variable
    name and type C-x C-s to save.
    
    Fixes #857
    
    Reported-by: Thomas Fini Hansen <https://github.com/xendk>
---
 company.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/company.el b/company.el
index 7b2dd5e..3c13b7b 100644
--- a/company.el
+++ b/company.el
@@ -832,7 +832,7 @@ means that `company-mode' is always turned on except in 
`message-mode' buffers."
 (defun company--company-command-p (keys)
   "Checks if the keys are part of company's overriding keymap"
   (or (equal [company-dummy-event] keys)
-      (lookup-key company-my-keymap keys)))
+      (commandp (lookup-key company-my-keymap keys))))
 
 ;; Hack:
 ;; Emacs calculates the active keymaps before reading the event.  That means we



reply via email to

[Prev in Thread] Current Thread [Next in Thread]