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)