[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 46/52: Never delete the "added newline" twice
From: |
Dmitry Gutov |
Subject: |
[elpa] 46/52: Never delete the "added newline" twice |
Date: |
Tue, 01 Jul 2014 11:53:33 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 81e65de7876baca67ce6d9d2a9c5719ddf36312e
Author: Dmitry Gutov <address@hidden>
Date: Fri Jun 27 06:14:27 2014 +0300
Never delete the "added newline" twice
Even when a hook or a backend method raises an error.
Possibly related to #145.
---
company.el | 55 ++++++++++++++++++++++++++++---------------------------
1 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/company.el b/company.el
index 7066817..485df72 100644
--- a/company.el
+++ b/company.el
@@ -1435,33 +1435,34 @@ from the rest of the back-ends in the group, if any,
will be left at the end."
;; Only set unmodified when tick remained the same since insert,
;; and the buffer wasn't modified before.
(set-buffer-modified-p 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)))
- (setq company-added-newline nil
- company-backend nil
- company-prefix nil
- company-candidates nil
- company-candidates-length nil
- company-candidates-cache nil
- company-candidates-predicate nil
- company-common nil
- company-selection 0
- company-selection-changed nil
- company--manual-action nil
- company--manual-prefix nil
- company-lighter company-default-lighter
- company--point-max nil
- company-point nil)
- (when company-timer
- (cancel-timer company-timer))
- (company-search-mode 0)
- (company-call-frontends 'hide)
- (company-enable-overriding-keymap nil)
+ (unwind-protect
+ (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-added-newline nil
+ company-backend nil
+ company-prefix nil
+ company-candidates nil
+ company-candidates-length nil
+ company-candidates-cache nil
+ company-candidates-predicate nil
+ company-common nil
+ company-selection 0
+ company-selection-changed nil
+ company--manual-action nil
+ company--manual-prefix nil
+ company-lighter company-default-lighter
+ company--point-max nil
+ company-point nil)
+ (when company-timer
+ (cancel-timer company-timer))
+ (company-search-mode 0)
+ (company-call-frontends 'hide)
+ (company-enable-overriding-keymap nil))
;; Make return value explicit.
nil)
- [elpa] 33/52: company-css: add a bunch of CSS3 properties, (continued)
- [elpa] 33/52: company-css: add a bunch of CSS3 properties, Dmitry Gutov, 2014/07/01
- [elpa] 36/52: company-css-property-alist: remove reference to font-variant in value for font, Dmitry Gutov, 2014/07/01
- [elpa] 34/52: company-gtags: add arguments insertion, Dmitry Gutov, 2014/07/01
- [elpa] 38/52: Indicate current candidate's backend when it's in a group, Dmitry Gutov, 2014/07/01
- [elpa] 39/52: company-update-group-lighter: privatize, Dmitry Gutov, 2014/07/01
- [elpa] 41/52: Improve comment wording, Dmitry Gutov, 2014/07/01
- [elpa] 37/52: company-pseudo-tooltip-edit: update company-width, Dmitry Gutov, 2014/07/01
- [elpa] 44/52: company-keywords-alist: ass js-mode -> javascript-mode alias, Dmitry Gutov, 2014/07/01
- [elpa] 43/52: company--should-idle-begin: use a more careful check, Dmitry Gutov, 2014/07/01
- [elpa] 42/52: Don't assign to company-point in company-abort and company-finish, Dmitry Gutov, 2014/07/01
- [elpa] 46/52: Never delete the "added newline" twice,
Dmitry Gutov <=
- [elpa] 47/52: Don't call post-completion methods and hook in continue-failed case, Dmitry Gutov, 2014/07/01
- [elpa] 45/52: Bring back this-command check when company-idle-delay is t, Dmitry Gutov, 2014/07/01
- [elpa] 40/52: Define company-sort-by-backend-importance, Dmitry Gutov, 2014/07/01
- [elpa] 49/52: company-backends: add better introduction, Dmitry Gutov, 2014/07/01
- [elpa] 48/52: Avoid requiring match is certain circumstances, Dmitry Gutov, 2014/07/01
- [elpa] 35/52: company-css: Add HTML5 tags and more CSS3 properties, Dmitry Gutov, 2014/07/01
- [elpa] 51/52: Release 0.8.1, Dmitry Gutov, 2014/07/01
- [elpa] 52/52: Merge commit '7c14dedc79bf0c6eaad5bf50b80ea80dd721afdc' from company, Dmitry Gutov, 2014/07/01
- [elpa] 50/52: company-capf.el: Don't ignore things like semantic-capf, Dmitry Gutov, 2014/07/01