mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add :ui fci module for fill-column-indicator
This commit is contained in:
16
modules/ui/fci/autoload.el
Normal file
16
modules/ui/fci/autoload.el
Normal file
@ -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)))
|
14
modules/ui/fci/config.el
Normal file
14
modules/ui/fci/config.el
Normal file
@ -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)))
|
4
modules/ui/fci/packages.el
Normal file
4
modules/ui/fci/packages.el
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; ui/fci/packages.el
|
||||||
|
|
||||||
|
(package! fill-column-indicator)
|
Reference in New Issue
Block a user