summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tom Willemse2016-03-17 00:39:42 +0100
committerGravatar Tom Willemse2016-03-17 00:39:42 +0100
commitec1a9aa30c27c02b92b6c433cdb86773ae55734e (patch)
tree7cac3ff02557d12c01724d7a5dca8b059d3113fe /emacs
parent94aad9cdb43e8fc1fe944e7f9b9cdb3553269925 (diff)
downloaddotfiles-ec1a9aa30c27c02b92b6c433cdb86773ae55734e.tar.gz
dotfiles-ec1a9aa30c27c02b92b6c433cdb86773ae55734e.zip
Fix company in non-fci buffers
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index e2ed37b..a2e6e4d 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -665,9 +665,22 @@ MODE1 is enabled and vice-versa."
;; when it finishes or is cancelled. This is to work around a
;; long-standing incompatibility between company (as well as
;; auto-complete) and fill-column-indicator.
-(add-hook 'company-completion-started-hook (lambda (&rest _) (fci-mode -1)))
-(add-hook 'company-completion-cancelled-hook (lambda (&rest _) (fci-mode 1)))
-(add-hook 'company-completion-finished-hook (lambda (&rest _) (fci-mode 1)))
+(defvar-local oni:company-fci-enabled-p nil)
+(add-hook 'company-completion-started-hook
+ (lambda (&rest _)
+ (when fci-mode
+ (setq-local oni:company-fci-enabled-p t)
+ (fci-mode -1))))
+(add-hook 'company-completion-cancelled-hook
+ (lambda (&rest _)
+ (when oni:company-fci-enabled-p
+ (fci-mode 1)
+ (setq-local oni:company-fci-enabled-p nil))))
+(add-hook 'company-completion-finished-hook
+ (lambda (&rest _)
+ (when oni:company-fci-enabled-p
+ (fci-mode 1)
+ (setq-local oni:company-fci-enabled-p nil))))
;; Load my theme
(if (daemonp)