Closed eval-exec closed 2 months ago
You can take a look at https://github.com/manateelazycat/lsp-bridge/blob/ac402603a5f3f64e61fae8194fd3be8f3f3dea06/acm/acm.el#L677 here
Did you use a centering plugin like olivetti?
I didn't use `centering plugin like olivetti or writeroom-mode.
If I hack acm-frame-get-popup-position
to this, only change
(cons (+ x window-left)
(+ y window-top offset-y))
to
(cons (+ x window-left 88)
(+ y window-top offset-y))
then the popup menu looks align well...
(defun acm-frame-get-popup-position (frame-popup-point &optional line-bias)
(let* ((edges (window-pixel-edges))
(window-left (+ (nth 0 edges)
;; We need adjust left margin for buffer centering module.
(/ (- (window-pixel-width)
(window-body-width nil t))
2)))
(window-top (nth 1 edges))
(pos (posn-x-y (posn-at-point frame-popup-point)))
(x (car pos))
(y (+ (cdr pos) (* (or line-bias 0) (line-pixel-height))))
(offset-y
;; We need move down to skip tab-line and header-line.
(if (version< emacs-version "27.0")
(window-header-line-height)
(+ (window-tab-line-height)
(window-header-line-height)))))
(cons (+ x window-left 88)
(+ y window-top offset-y))))
@manateelazycat
What do you think using (window-absolute-pixel-position)
to get the acm-frame-get-popup-position
?
Ref: https://emacs.stackexchange.com/questions/19555/obtain-absolute-pixel-position-of-point
上面是我的截图, 你的Emacs不支持svg图标渲染, 还是你禁用了图标?
@eval-exec I have push new patch https://github.com/manateelazycat/lsp-bridge/commit/12302c741eafdab370fb619460979de930458a53
This patch will adjust acm menu position follow option acm-enable-icon
and acm-enable-quick-access
.
Thanks for feedback
I am running KDE Plasma 6 on a HiDPI screen with a resolution of 3840x2160. I am using Xwayland to run Emacs, and the completion menu in the lsp-bridge does not align properly with the current cursor position.
lsp-bridge version:
* ac40260 - (HEAD -> master, origin/master, origin/HEAD) Add new option acm-backend-lsp-block-kind-list (18 hours ago) <Andy Stewart>
system:"x86_64-linux"
host os:Linux 6.8.6, NixOS, 24.05 (Uakari), 24.05.20240416.5672bc9
DE:KDE Plasma 6.0.3
WM:KWin (Wayland)
What environment variables or configurations can affect the position of acm-popup-menu? What information should I provide to help analyze this issue?
Thank you. :blue_heart:
Screencast_20240420_103416.webm