From 34a53832f1bdd16a6f75b31fb91cf95d63f0cc0e Mon Sep 17 00:00:00 2001 From: was Date: Sat, 5 Aug 2023 08:18:41 +0800 Subject: [PATCH] Let the reference display in the center to view the relevant above. --- lsp-bridge-peek.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lsp-bridge-peek.el b/lsp-bridge-peek.el index 4772ce5672..c3c745bdab 100644 --- a/lsp-bridge-peek.el +++ b/lsp-bridge-peek.el @@ -550,7 +550,11 @@ The beginnings of each symbol are replaced by ace strings with (setq pos (list :line (string-to-number line) :character (string-to-number char))) (push filename (nth 1 lsp-bridge-peek-symbol-at-point)) (push pos (nth 2 lsp-bridge-peek-symbol-at-point)) - (push 0 (nth 6 lsp-bridge-peek-symbol-at-point))))) + (setf (nth 6 lsp-bridge-peek-symbol-at-point) + (nreverse (nth 6 lsp-bridge-peek-symbol-at-point))) + (push (- (/ lsp-bridge-peek-file-content-height 2)) (nth 6 lsp-bridge-peek-symbol-at-point)) + (setf (nth 6 lsp-bridge-peek-symbol-at-point) + (nreverse (nth 6 lsp-bridge-peek-symbol-at-point)))))) (setf (nth 1 lsp-bridge-peek-symbol-at-point) (nreverse (nth 1 lsp-bridge-peek-symbol-at-point)) (nth 2 lsp-bridge-peek-symbol-at-point) @@ -767,13 +771,16 @@ The buffer and the point is returned in a cons cell." (selected-symbol (nth lsp-bridge-peek-selected-symbol lsp-bridge-peek-symbol-tree)) (path-list (nth 1 selected-symbol)) (pos-list (nth 2 selected-symbol)) + (content-move-list (nth 6 selected-symbol)) (file (nth selected-id path-list)) (buf (format "*lsp-bridge-peek-%s*" file)) - (pos (nth selected-id pos-list))) + (pos (nth selected-id pos-list)) + (content-move (nth selected-id content-move-list))) (setq lsp-bridge-peek--symbol-bounds (with-current-buffer buf (save-excursion (goto-char (acm-backend-lsp-position-to-point pos)) + (forward-line content-move) (beginning-of-line 1) (cons (point) (lsp-bridge-peek--search-symbols