summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
Diffstat (limited to 'init.org')
-rw-r--r--init.org19
1 files changed, 19 insertions, 0 deletions
diff --git a/init.org b/init.org
index 6d93360..dcfcaa6 100644
--- a/init.org
+++ b/init.org
@@ -883,9 +883,28 @@ This is even more stuff to be done after initialising packages. I still need to
(require 'fill-column-indicator)
(setq fci-rule-use-dashes t)
+(setq fci-rule-color "#cccccc")
(setq fci-dash-pattern 0.3)
(add-hook 'prog-mode-hook 'fci-mode)
+;; This is a workaround to display the company-mode completion popup
+;; when fci-mode is enabled. It was taken from here:
+;; https://github.com/company-mode/company-mode/issues/180#issuecomment-55047120
+(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)
+
+
;; keep the cursor centered to avoid sudden scroll jumps
(require 'centered-cursor-mode)