From 2293f8c2cd6b1e0ba8951b4a7081ea3e4d1f710b Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Tue, 23 Apr 2024 03:39:04 -0700 Subject: [PATCH] feat: Partial scroll bars support (#774) * feat: Partial scroll bars support * rev no-focus-on-map --- lsp-ui-doc.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el index 044664e7..71bbd070 100644 --- a/lsp-ui-doc.el +++ b/lsp-ui-doc.el @@ -516,9 +516,12 @@ FRAME just below the symbol at point." (if (< (car it) (window-start)) (cons 0 0) (posn-x-y (posn-at-point (1- (window-end)))))))) - (frame-relative-symbol-x (+ start-x x (* (frame-char-width) 2))) - (frame-relative-symbol-y (+ start-y y)) + (char-width (frame-char-width)) (char-height (frame-char-height)) + (sbw (or (window-scroll-bar-width) 0)) + (sbh (or (window-scroll-bar-height) 0)) + (frame-relative-symbol-x (+ start-x x (* char-width 2) sbw)) + (frame-relative-symbol-y (+ start-y y (- 0 sbh))) ;; Make sure the frame is positioned horizontally such that ;; it does not go beyond the frame boundaries. (frame-x (or (and (<= (frame-outer-width) (+ frame-relative-symbol-x width)) @@ -526,7 +529,7 @@ FRAME just below the symbol at point." (frame-outer-width)))) x)) (frame-y (+ (or (and (<= height frame-relative-symbol-y) - (- y height)) + (- y height sbh)) (+ y char-height)) (if (fboundp 'window-tab-line-height) (window-tab-line-height) 0)))) (cons (+ start-x frame-x) (+ start-y frame-y))))