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:
parent
9f715a5cf7
commit
b89ce54df3
|
@ -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")
|
||||
|
|
|
@ -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")))
|
||||
|
||||
|
|
Loading…
Reference in a new issue