Add work-around for issues with company and fci-mode

This commit is contained in:
2017-08-21 01:56:03 +01:00
parent d4b9e31700
commit d6e6606f12

View File

@@ -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