Follow ElDoc convension

Instead of clearing childframe on pre-command hook,
clear when display function is passed a nil argument
This commit is contained in:
Yuan Fu 2018-12-11 16:36:34 -05:00
parent 34004bf492
commit 317cd2ddfc
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901

View File

@ -74,7 +74,10 @@
(defun eldoc-box-help-at-point ()
"Display hover info at point in a childframe."
(interactive)
(eldoc-message (funcall eldoc-documentation-function)))
(let ((doc (funcall eldoc-documentation-function)))
(when doc
(eldoc-box--display doc)
(eldoc-box--inject-quit-func))))
(defun eldoc-box-quit-frame ()
"Hide childframe used by eglot doc."
@ -101,8 +104,7 @@
(setq mode-line-format nil)
(erase-buffer)
(insert str)
(eldoc-box--get-frame doc-buffer))
(eldoc-box--inject-quit-func)))
(eldoc-box--get-frame doc-buffer))))
(defun eldoc-box-quit-hook ()
"Quit eglot doc childframe and remove self from hook."