Skip to content

Commit b6d12dd

Browse files
authored
fix(ui-doc): Hide doc frame on next post command (#775)
1 parent 2293f8c commit b6d12dd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lsp-ui-doc.el

+9-2
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ It is supposed to be called from `lsp-ui--toggle'"
12471247
(interactive)
12481248
(when-let* ((frame (lsp-ui-doc--get-frame))
12491249
(visible (lsp-ui-doc--frame-visible-p)))
1250+
(remove-hook 'post-command-hook 'lsp-ui-doc--unfocus-frame-post-command)
12501251
(remove-hook 'post-command-hook 'lsp-ui-doc--hide-frame)
12511252
(set-frame-parameter frame 'lsp-ui-doc--no-focus nil)
12521253
(set-frame-parameter frame 'cursor-type t)
@@ -1263,8 +1264,14 @@ It is supposed to be called from `lsp-ui--toggle'"
12631264
(set-frame-parameter frame 'cursor-type nil)
12641265
(lsp-ui-doc--with-buffer
12651266
(setq cursor-type nil))
1266-
(when lsp-ui-doc--from-mouse
1267-
(make-frame-invisible frame))))
1267+
(if lsp-ui-doc--from-mouse
1268+
(make-frame-invisible frame)
1269+
(add-hook'post-command-hook 'lsp-ui-doc--unfocus-frame-post-command))))
1270+
1271+
(defun lsp-ui-doc--unfocus-frame-post-command ()
1272+
"Hide frame on the next post command after unfocus frame."
1273+
(add-hook 'post-command-hook 'lsp-ui-doc--hide-frame)
1274+
(remove-hook 'post-command-hook 'lsp-ui-doc--unfocus-frame-post-command))
12681275

12691276
(provide 'lsp-ui-doc)
12701277
;;; lsp-ui-doc.el ends here

0 commit comments

Comments
 (0)