From b212429b0d8fa86b0cb2abfd6d061b3681afe443 Mon Sep 17 00:00:00 2001 From: Lenbok Date: Tue, 9 Aug 2022 09:21:54 +1200 Subject: [PATCH 1/2] lsp-ui-doc: Support hiding doc when focus is in frame Ensure focus is out of doc frame before attempting to hide the frame. Be explicit that focusing into the doc frame will cancel "glance" dismissal. --- lsp-ui-doc.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el index 40dce65f..a23b693f 100644 --- a/lsp-ui-doc.el +++ b/lsp-ui-doc.el @@ -1178,6 +1178,7 @@ It is supposed to be called from `lsp-ui--toggle'" (defun lsp-ui-doc-hide () "Hide hover information popup." (interactive) + (lsp-ui-doc-unfocus-frame) ;; In case focus is in doc frame (lsp-ui-doc--hide-frame)) (defun lsp-ui-doc-glance () @@ -1200,6 +1201,7 @@ It is supposed to be called from `lsp-ui--toggle'" (interactive) (when-let* ((frame (lsp-ui-doc--get-frame)) (visible (lsp-ui-doc--frame-visible-p))) + (remove-hook 'post-command-hook 'lsp-ui-doc--hide-frame) (set-frame-parameter frame 'lsp-ui-doc--no-focus nil) (set-frame-parameter frame 'cursor-type t) (lsp-ui-doc--with-buffer From 23c95ff3231abf588cb8c8bb48bcfdcc4bf6ebcf Mon Sep 17 00:00:00 2001 From: Lenbok Date: Tue, 9 Aug 2022 09:25:00 +1200 Subject: [PATCH 2/2] Tidy as you go --- lsp-ui-doc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el index a23b693f..bef380ed 100644 --- a/lsp-ui-doc.el +++ b/lsp-ui-doc.el @@ -64,7 +64,8 @@ (defcustom lsp-ui-doc-enable t "Whether or not to enable lsp-ui-doc. -Displays documentation of the symbol at point on hover. This only takes effect when a buffer is started." +Displays documentation of the symbol at point on hover. This only +takes effect when a buffer is started." :type 'boolean :group 'lsp-ui)