diff --git a/eldoc-box.el b/eldoc-box.el index 2c6e7e4..ce6021f 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -185,22 +185,22 @@ Intended for internal use." ;;;;; Function (defun eldoc-box--display (str) - "Display STR in childframe." - (unless (equal str "") ; WORKAROUND lsp returns empty string from time to time - (let ((doc-buffer (get-buffer-create eldoc-box--buffer))) - (with-current-buffer doc-buffer - (setq mode-line-format nil) - (when (bound-and-true-p global-tab-line-mode) - (setq tab-line-format nil)) - ;; without this, clicking childframe will make doc buffer the current buffer - ;; and `eldoc-box--maybe-cleanup' in `eldoc-box--cleanup-timer' will clear the childframe - (buffer-face-set 'eldoc-box-body) - (setq eldoc-box-hover-mode t) - (erase-buffer) - (insert str) - (goto-char (point-min)) - (run-hook-with-args 'eldoc-box-buffer-hook)) - (eldoc-box--get-frame doc-buffer)))) + "Display STR in childframe. +STR has to be a proper documentation, not empty string, not nil, etc." + (let ((doc-buffer (get-buffer-create eldoc-box--buffer))) + (with-current-buffer doc-buffer + (setq mode-line-format nil) + (when (bound-and-true-p global-tab-line-mode) + (setq tab-line-format nil)) + ;; without this, clicking childframe will make doc buffer the current buffer + ;; and `eldoc-box--maybe-cleanup' in `eldoc-box--cleanup-timer' will clear the childframe + (buffer-face-set 'eldoc-box-body) + (setq eldoc-box-hover-mode t) + (erase-buffer) + (insert str) + (goto-char (point-min)) + (run-hook-with-args 'eldoc-box-buffer-hook)) + (eldoc-box--get-frame doc-buffer))) (defun eldoc-box--window-side ()