Originally I have (when str (display)), but that leaves childdrame
unchanged.
To work around that I added (eldoc-box-quit-frame).
Now childframes are cleared up nicely but it lagging.

(when (stringp str) (display)) works. (although I don't know why (when
str) doesn't, even though eldoc-messaeg passes nil to message function)
This commit is contained in:
Yuan Fu 2018-12-11 15:39:31 -05:00
parent f0c99152d2
commit 60f758a24a
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901

View File

@ -175,8 +175,7 @@ Checkout `lsp-ui-doc--make-frame', `lsp-ui-doc--move-frame'."
;;;;; ElDoc ;;;;; ElDoc
(defun eldoc-box--eldoc-message-function (str &rest args) (defun eldoc-box--eldoc-message-function (str &rest args)
"Frontend for eldoc. Display STR in childframe and ARGS works like `message'." "Frontend for eldoc. Display STR in childframe and ARGS works like `message'."
(when str (when (stringp str)
(eldoc-box-quit-frame)
(let ((doc (apply #'format str args))) (let ((doc (apply #'format str args)))
(if (and eldoc-box-only-multi-line (eq (cl-count ?\n doc) 0)) (if (and eldoc-box-only-multi-line (eq (cl-count ?\n doc) 0))
(apply #'eldoc-minibuffer-message str args) (apply #'eldoc-minibuffer-message str args)