Try to place lsp-ui-doc popups in less annoying places
This commit is contained in:
parent
7224ec283b
commit
674e7dc5aa
@ -597,9 +597,21 @@
|
|||||||
([remap xref-find-references] . lsp-ui-peek-find-references))
|
([remap xref-find-references] . lsp-ui-peek-find-references))
|
||||||
:config
|
:config
|
||||||
(setq lsp-ui-sideline-ignore-duplicate t
|
(setq lsp-ui-sideline-ignore-duplicate t
|
||||||
lsp-ui-doc-max-height 10
|
lsp-ui-doc-max-height 5
|
||||||
|
lsp-ui-doc-max-width 70
|
||||||
;; lsp-ui-sideline-update-mode 'point
|
;; lsp-ui-sideline-update-mode 'point
|
||||||
))
|
)
|
||||||
|
|
||||||
|
(defun adjust-lsp-ui-doc-frame-pos (orig-fun &rest args)
|
||||||
|
(let* ((y-position-in-window (nth 1 (pos-visible-in-window-p (point) nil t)))
|
||||||
|
(edges (window-absolute-body-pixel-edges))
|
||||||
|
(bottom-edge (- (nth 3 edges) (nth 1 edges)))
|
||||||
|
(lsp-ui-doc-max-height (/ (window-height) 5))
|
||||||
|
(lsp-ui-doc-position (if (< (/ (float y-position-in-window) bottom-edge) 0.5) 'bottom 'top)))
|
||||||
|
(when (lsp-ui-doc--get-frame)
|
||||||
|
(lsp-ui-doc--move-frame (lsp-ui-doc--get-frame)))
|
||||||
|
(apply orig-fun args)))
|
||||||
|
(advice-add 'lsp-ui-doc--display :around #'adjust-lsp-ui-doc-frame-pos))
|
||||||
|
|
||||||
(use-package lsp-python-ms :demand :if (package-installed-p 'lsp-python-ms))
|
(use-package lsp-python-ms :demand :if (package-installed-p 'lsp-python-ms))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user