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

fix: Calculate scroll-bars size in frame #776

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions lsp-ui-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ We don't extract the string that `lps-line' is already displaying."
(lsp-ui-doc--with-buffer
(fill-region (point-min) (point-max)))))))

(defun lsp-ui-doc--mv-at-point (width height start-x start-y)
(defun lsp-ui-doc--mv-at-point (frame width height start-x start-y)
"Return position of FRAME to be where the point is.
WIDTH is the child frame width.
HEIGHT is the child frame height.
Expand All @@ -518,8 +518,8 @@ FRAME just below the symbol at point."
(posn-x-y (posn-at-point (1- (window-end))))))))
(char-width (frame-char-width))
(char-height (frame-char-height))
(sbw (or (window-scroll-bar-width) 0))
(sbh (or (window-scroll-bar-height) 0))
(sbw (with-selected-frame frame (or (window-scroll-bar-width) 0)))
(sbh (with-selected-frame frame (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
Expand Down Expand Up @@ -555,7 +555,7 @@ FRAME just below the symbol at point."
('frame (frame-pixel-width))
('window right)))
((left . top) (if (eq lsp-ui-doc-position 'at-point)
(lsp-ui-doc--mv-at-point width height left top)
(lsp-ui-doc--mv-at-point frame width height left top)
(cons (pcase lsp-ui-doc-side
('right (max (- frame-right width char-w) 10))
('left 10))
Expand Down
7 changes: 1 addition & 6 deletions lsp-ui-util.el
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
;;; lsp-ui-util.el --- Utility module for Lsp-Ui -*- lexical-binding: t -*-

;; Copyright (C) 2020 Shen, Jen-Chieh

;; Author: Jen-Chieh Shen <[email protected]>
;; URL: https://github.com/emacs-lsp/lsp-ui
;; Keywords: languages, tools
;; Version: 6.2
;; Copyright (C) 2020-2024 Shen, Jen-Chieh

;;; License
;;
Expand Down
1 change: 0 additions & 1 deletion lsp-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,5 @@ Both should have the form (FILENAME LINE COLUMN)."
(cons idx (length refs)))
(cons 0 0))))


(provide 'lsp-ui)
;;; lsp-ui.el ends here
Loading