]> code.delx.au - gnu-emacs-elpa/commitdiff
Revert "company-cancel: Call frontends' 'hide before 'post-completion"
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 14 Jan 2016 17:48:59 +0000 (20:48 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 14 Jan 2016 17:48:59 +0000 (20:48 +0300)
This reverts commit 2dd1f6a2dc8ae1d507385fcb9edd95602fd7dcb9.

Fixes #456

company.el

index f83eeb45a3704d97295e75c6fbdf2f409b774192..117b09302ec47f8b2bedebf2ea7abe4d64c66847 100644 (file)
@@ -1526,20 +1526,13 @@ from the rest of the backends in the group, if any, will be left at the end."
 
 (defun company-cancel (&optional result)
   (unwind-protect
-      (progn
-        (when company-timer
-          (cancel-timer company-timer))
-        (company-echo-cancel t)
-        (company-search-mode 0)
-        (company-call-frontends 'hide)
-        (company-enable-overriding-keymap nil)
-        (when company-prefix
-          (if (stringp result)
-              (progn
-                (company-call-backend 'pre-completion result)
-                (run-hook-with-args 'company-completion-finished-hook result)
-                (company-call-backend 'post-completion result))
-            (run-hook-with-args 'company-completion-cancelled-hook result))))
+      (when company-prefix
+        (if (stringp result)
+            (progn
+              (company-call-backend 'pre-completion result)
+              (run-hook-with-args 'company-completion-finished-hook result)
+              (company-call-backend 'post-completion result))
+          (run-hook-with-args 'company-completion-cancelled-hook result)))
     (setq company-backend nil
           company-prefix nil
           company-candidates nil
@@ -1552,7 +1545,13 @@ from the rest of the backends in the group, if any, will be left at the end."
           company--manual-action nil
           company--manual-prefix nil
           company--point-max nil
-          company-point nil))
+          company-point nil)
+    (when company-timer
+      (cancel-timer company-timer))
+    (company-echo-cancel t)
+    (company-search-mode 0)
+    (company-call-frontends 'hide)
+    (company-enable-overriding-keymap nil))
   ;; Make return value explicit.
   nil)
 
@@ -2961,8 +2960,8 @@ Returns a negative number if the tooltip should be displayed above point."
             "}")))
 
 (defun company-echo-hide ()
-  (unless (null company-echo-last-msg)
-    (setq company-echo-last-msg nil)
+  (unless (equal company-echo-last-msg "")
+    (setq company-echo-last-msg "")
     (company-echo-show)))
 
 (defun company-echo-frontend (command)