diff --git a/oni-company.el b/oni-company.el index 74aa826..2153f46 100644 --- a/oni-company.el +++ b/oni-company.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190523070353 +;; Version: 20190523075637 ;; Package-Requires: (company company-posframe diminish) ;; This program is free software; you can redistribute it and/or modify @@ -31,6 +31,13 @@ (require 'company-posframe) (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-idle-delay 0.2) (setq company-tooltip-align-annotations t) @@ -40,10 +47,10 @@ company-echo-metadata-frontend company-preview-frontend)) -(company-posframe-mode) +(add-hook 'company-completion-started-hook 'oni-company--enable-posframe) (diminish 'company-mode) -(diminish 'company-posrame-mode) +(diminish 'company-posframe-mode) ;;;###autoload(with-eval-after-load 'company (require 'oni-company))