Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lsp UI doc hide from focused frame #729

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lsp-ui-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -1178,6 +1179,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 ()
Expand All @@ -1200,6 +1202,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
Expand Down