1
0
Fork 0

Enable company-posframe as late as possible

‘company-posframe’ checks to see if posframe can actually work. Unfortunately it
thinks it can’t work when the first frame is created. So instead only enable
‘company-posframe-mode’ when company starts trying to complete something.
This commit is contained in:
Tom Willemse 2019-05-23 07:57:01 -07:00
parent a990b9d4d9
commit 893c9e2249

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190523070353 ;; Version: 20190523075637
;; Package-Requires: (company company-posframe diminish) ;; Package-Requires: (company company-posframe diminish)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -31,6 +31,13 @@
(require 'company-posframe) (require 'company-posframe)
(require 'diminish) (require 'diminish)
(defun oni-company--enable-posframe (_)
"Enable posframe and remove this function from the hook."
(when (display-graphic-p)
(company-posframe-mode)
(remove-hook 'company-completion-started-hook
'oni-company--enable-posframe)))
(setq company-dabbrev-ignore-case nil) (setq company-dabbrev-ignore-case nil)
(setq company-idle-delay 0.2) (setq company-idle-delay 0.2)
(setq company-tooltip-align-annotations t) (setq company-tooltip-align-annotations t)
@ -40,10 +47,10 @@
company-echo-metadata-frontend company-echo-metadata-frontend
company-preview-frontend)) company-preview-frontend))
(company-posframe-mode) (add-hook 'company-completion-started-hook 'oni-company--enable-posframe)
(diminish 'company-mode) (diminish 'company-mode)
(diminish 'company-posrame-mode) (diminish 'company-posframe-mode)
;;;###autoload(with-eval-after-load 'company (require 'oni-company)) ;;;###autoload(with-eval-after-load 'company (require 'oni-company))