Skip to content

Commit e5a5623

Browse files
authored
Allow lsp UI doc hide from focused frame (#729)
lsp-ui-doc: Support hiding doc when focus is in frame
1 parent 8d4fa5a commit e5a5623

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lsp-ui-doc.el

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464

6565
(defcustom lsp-ui-doc-enable t
6666
"Whether or not to enable lsp-ui-doc.
67-
Displays documentation of the symbol at point on hover. This only takes effect when a buffer is started."
67+
Displays documentation of the symbol at point on hover. This only
68+
takes effect when a buffer is started."
6869
:type 'boolean
6970
:group 'lsp-ui)
7071

@@ -1178,6 +1179,7 @@ It is supposed to be called from `lsp-ui--toggle'"
11781179
(defun lsp-ui-doc-hide ()
11791180
"Hide hover information popup."
11801181
(interactive)
1182+
(lsp-ui-doc-unfocus-frame) ;; In case focus is in doc frame
11811183
(lsp-ui-doc--hide-frame))
11821184

11831185
(defun lsp-ui-doc-glance ()
@@ -1200,6 +1202,7 @@ It is supposed to be called from `lsp-ui--toggle'"
12001202
(interactive)
12011203
(when-let* ((frame (lsp-ui-doc--get-frame))
12021204
(visible (lsp-ui-doc--frame-visible-p)))
1205+
(remove-hook 'post-command-hook 'lsp-ui-doc--hide-frame)
12031206
(set-frame-parameter frame 'lsp-ui-doc--no-focus nil)
12041207
(set-frame-parameter frame 'cursor-type t)
12051208
(lsp-ui-doc--with-buffer

0 commit comments

Comments
 (0)