mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
chore(completion): only load company/fci-mode fix when fci is loaded
This commit is contained in:
@@ -7,11 +7,6 @@
|
||||
;;; Code:
|
||||
|
||||
(use-package company
|
||||
:hook
|
||||
(company-completion-started . siren-company--turn-off-fci)
|
||||
(company-completion-finished . siren-company--maybe-turn-on-fci)
|
||||
(company-completion-cancelled . siren-company--maybe-turn-on-fci)
|
||||
|
||||
:bind
|
||||
;; Enable indent and complete at point functionality by pressing tab.
|
||||
("TAB" . company-indent-or-complete-common)
|
||||
@@ -31,21 +26,28 @@
|
||||
;; is displayed on top (happens near the bottom of windows)
|
||||
(company-tooltip-flip-when-above t)
|
||||
|
||||
:init
|
||||
(defun siren-company--turn-off-fci (&rest ignore)
|
||||
(when (boundp 'fci-mode)
|
||||
(when fci-mode
|
||||
(turn-off-fci-mode)
|
||||
(setq siren-company--fci-mode-on-p t))))
|
||||
|
||||
(defun siren-company--maybe-turn-on-fci (&rest ignore)
|
||||
(when siren-company--fci-mode-on-p
|
||||
(turn-on-fci-mode)
|
||||
(setq siren-company--fci-mode-on-p nil)))
|
||||
|
||||
:config
|
||||
(defvar-local siren-company--fci-mode-on-p nil)
|
||||
(global-company-mode 1))
|
||||
(global-company-mode 1)
|
||||
|
||||
(with-eval-after-load 'fill-column-indicator
|
||||
(defun siren-company--turn-off-fci (&rest ignore)
|
||||
(when (boundp 'fci-mode)
|
||||
(when fci-mode
|
||||
(turn-off-fci-mode)
|
||||
(setq siren-company--fci-mode-on-p t))))
|
||||
|
||||
(defun siren-company--maybe-turn-on-fci (&rest ignore)
|
||||
(when siren-company--fci-mode-on-p
|
||||
(turn-on-fci-mode)
|
||||
(setq siren-company--fci-mode-on-p nil)))
|
||||
|
||||
(add-hook 'company-completion-started-hook
|
||||
#'siren-company--turn-off-fci)
|
||||
(add-hook 'company-completion-finished-hook
|
||||
#'siren-company--maybe-turn-on-fci)
|
||||
(add-hook 'company-completion-cancelled-hook
|
||||
#'siren-company--maybe-turn-on-fci)))
|
||||
|
||||
(provide 'siren-company)
|
||||
;;; siren-company.el ends here
|
||||
|
||||
Reference in New Issue
Block a user