Skip to content

Commit 13d1569

Browse files
sebastiencsbrotzeit
authored andcommitted
[lsp-ui-doc] Fix frame positioning when bound is outside window #519
1 parent 7d22cf1 commit 13d1569

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lsp-ui-doc.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ symbol at point, to not obstruct the view of the code that follows.
467467
If there's no space above in the current window, it places
468468
FRAME just below the symbol at point."
469469
(-let* (((x . y) (--> (or lsp-ui-doc--bounds (bounds-of-thing-at-point 'symbol))
470-
(posn-x-y (posn-at-point (car it)))))
470+
(or (posn-x-y (posn-at-point (car it)))
471+
(if (< (car it) (window-start))
472+
(cons 0 0)
473+
(posn-x-y (posn-at-point (1- (window-end))))))))
471474
(frame-relative-symbol-x (+ start-x x))
472475
(frame-relative-symbol-y (+ start-y y))
473476
(char-height (frame-char-height))

0 commit comments

Comments
 (0)