Skip to content

Commit

Permalink
fix(ui-doc): Hide doc frame on next post command
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Apr 23, 2024
1 parent 2293f8c commit 48c1cc7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lsp-ui-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,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--unfocus-frame-post-command)
(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)
Expand All @@ -1263,8 +1264,14 @@ It is supposed to be called from `lsp-ui--toggle'"
(set-frame-parameter frame 'cursor-type nil)
(lsp-ui-doc--with-buffer
(setq cursor-type nil))
(when lsp-ui-doc--from-mouse
(make-frame-invisible frame))))
(if lsp-ui-doc--from-mouse
(make-frame-invisible frame)
(add-hook'post-command-hook 'lsp-ui-doc--unfocus-frame-post-command))))

(defun lsp-ui-doc--unfocus-frame-post-command ()
"Hide frame on the next post command after unfocus frame."
(add-hook 'post-command-hook 'lsp-ui-doc--hide-frame)
(remove-hook 'post-command-hook 'lsp-ui-doc--unfocus-frame-post-command))

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

0 comments on commit 48c1cc7

Please sign in to comment.