From 71dcb5dc9fa76153c569bc06837842474dcc53e3 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 23 Apr 2024 03:34:24 -0700 Subject: [PATCH] feat: Partial scroll bars support --- lsp-ui-doc.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lsp-ui-doc.el b/lsp-ui-doc.el index 044664e7..71a4e845 100644 --- a/lsp-ui-doc.el +++ b/lsp-ui-doc.el @@ -189,7 +189,7 @@ Only the `background' is used in this face." (defvar lsp-ui-doc-frame-parameters '((left . -1) - (no-focus-on-map . t) + (no-focus-on-map . nil) (min-width . 0) (width . 0) (min-height . 0) @@ -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))))