Fix company and fci-mode incompatibility

It is reported in this issue: https://github.com/company-mode/company-mode/issues/180
that company has distorted completion popup with fci-mode turned on.
Company maintainer proposed a fix for this issue that is added in this
commit.
This commit is contained in:
Tu Do 2015-04-22 17:45:27 +07:00 committed by syl20bnr
parent 9f715a5cf7
commit b89ce54df3
2 changed files with 15 additions and 2 deletions

View file

@ -75,6 +75,19 @@
company-dabbrev-downcase nil
company-frontends '(company-pseudo-tooltip-frontend)
company-clang-prefix-guesser 'company-mode/more-than-prefix-guesser))
(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)
:config
(progn
(spacemacs|diminish company-mode "" " a")

View file

@ -1090,6 +1090,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
:init
(progn
(setq fci-rule-width 1)
(setq fci-rule-color "#D0BF8F")
;; manually register the minor mode since it does not define any
;; lighter
(push '(fci-mode "") minor-mode-alist)
@ -1098,8 +1099,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
:on (turn-on-fci-mode)
:off (turn-off-fci-mode)
:documentation "Display the fill column indicator."
:evil-leader "tc")
(setq fci-rule-color "#D0BF8F"))
:evil-leader "tc"))
:config
(spacemacs|diminish fci-mode "" " c")))