From e918040e708bba99af9a08400a472cef84c97704 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 7 Jun 2018 18:28:31 +0200 Subject: [PATCH] Add :ui fci module for fill-column-indicator --- modules/ui/fci/autoload.el | 16 ++++++++++++++++ modules/ui/fci/config.el | 14 ++++++++++++++ modules/ui/fci/packages.el | 4 ++++ 3 files changed, 34 insertions(+) create mode 100644 modules/ui/fci/autoload.el create mode 100644 modules/ui/fci/config.el create mode 100644 modules/ui/fci/packages.el diff --git a/modules/ui/fci/autoload.el b/modules/ui/fci/autoload.el new file mode 100644 index 000000000..f59f555db --- /dev/null +++ b/modules/ui/fci/autoload.el @@ -0,0 +1,16 @@ +;;; ui/fci/autoload.el -*- lexical-binding: t; -*- + +(defvar-local +fci-last-state nil) + +;;;###autoload +(defun +fci|disable-when-company-activates (&rest ignore) + "TODO" + (setq +fci-last-state fci-mode) + (when fci-mode + (fci-mode -1))) + +;;;###autoload +(defun +fci|enable-when-company-deactivates (&rest ignore) + "TODO" + (when +fci-last-state + (fci-mode 1))) diff --git a/modules/ui/fci/config.el b/modules/ui/fci/config.el new file mode 100644 index 000000000..5aaf50ef3 --- /dev/null +++ b/modules/ui/fci/config.el @@ -0,0 +1,14 @@ +;;; ui/fci/config.el -*- lexical-binding: t; -*- + +(def-package! fill-column-indicator + :hook ((text-mode prog-mode conf-mode) . turn-on-fci-mode) + :config + (defun +fci|set-color () + (setq fci-rule-color (face-foreground 'line-number))) + (add-hook 'doom-load-theme-hook #'+fci|set-color) + (+fci|set-color) + + (when (featurep! :completion company) + (add-hook 'company-completion-started-hook #'+fci|disable-when-company-activates) + (add-hook! '(company-completion-finished-hook company-completion-cancelled-hook) + #'+fci|enable-when-company-deactivates))) diff --git a/modules/ui/fci/packages.el b/modules/ui/fci/packages.el new file mode 100644 index 000000000..26d8b1335 --- /dev/null +++ b/modules/ui/fci/packages.el @@ -0,0 +1,4 @@ +;; -*- no-byte-compile: t; -*- +;;; ui/fci/packages.el + +(package! fill-column-indicator)