diff --git a/modules/siren-company.el b/modules/siren-company.el index 8eebf7d..14dc2dd 100644 --- a/modules/siren-company.el +++ b/modules/siren-company.el @@ -8,6 +8,24 @@ (use-package company :config + + ;; work-around for issues with fci-mode + (require 'siren-fci) + + (defvar-local company-fci-mode-on-p nil) + + (defun company-turn-off-fci (&rest ignore) + (when (boundp 'fci-mode) + (setq company-fci-mode-on-p fci-mode) + (when fci-mode (fci-mode -1)))) + + (defun company-maybe-turn-on-fci (&rest ignore) + (when company-fci-mode-on-p (fci-mode 1))) + + (add-hook 'company-completion-started-hook 'company-turn-off-fci) + (add-hook 'company-completion-finished-hook 'company-maybe-turn-on-fci) + (add-hook 'company-completion-cancelled-hook 'company-maybe-turn-on-fci) + (setq company-begin-commands '(self-insert-command) company-dabbrev-downcase nil company-echo-delay 0