aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2023-06-19 23:31:03 +0100
committerJoão Távora2023-06-19 23:31:17 +0100
commit6f211bc57b922d55c9452bbfa7d01e50e82da25f (patch)
tree5d2c8e1d9d3675082ef8678d1d083f49a9810119
parenta24e9e3fee59435422af0473b7ec585de2c13b4e (diff)
downloademacs-6f211bc57b922d55c9452bbfa7d01e50e82da25f.tar.gz
emacs-6f211bc57b922d55c9452bbfa7d01e50e82da25f.zip
Eglot: again fix positions of coinciding inlay hint overlays (bug#64101)
This bug originated from the previous fix, and is reproducible on non Mac OS platforms, as long as the very latest version (at time of writing) of the rust-analyzer server is used. * lisp/progmodes/eglot.el (eglot--update-hints-1): Reverse priorities when pegging overlays after (i.e. when before-string is used).
-rw-r--r--lisp/progmodes/eglot.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 352a6ffd6b0..00f2e547e05 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3644,7 +3644,7 @@ If NOERROR, return predicate, else erroring function."
3644 (if peg-after-p 3644 (if peg-after-p
3645 (make-overlay (point) (1+ (point)) nil t) 3645 (make-overlay (point) (1+ (point)) nil t)
3646 (make-overlay (1- (point)) (point) nil nil nil))) 3646 (make-overlay (1- (point)) (point) nil nil nil)))
3647 (do-it (label lpad rpad i) 3647 (do-it (label lpad rpad i n)
3648 (let* ((firstp (zerop i)) 3648 (let* ((firstp (zerop i))
3649 (tweak-cursor-p (and firstp peg-after-p)) 3649 (tweak-cursor-p (and firstp peg-after-p))
3650 (ov (make-ov)) 3650 (ov (make-ov))
@@ -3657,18 +3657,18 @@ If NOERROR, return predicate, else erroring function."
3657 (1 'eglot-type-hint-face) 3657 (1 'eglot-type-hint-face)
3658 (2 'eglot-parameter-hint-face) 3658 (2 'eglot-parameter-hint-face)
3659 (_ 'eglot-inlay-hint-face)))) 3659 (_ 'eglot-inlay-hint-face))))
3660 (overlay-put ov 'priority i) 3660 (overlay-put ov 'priority (if peg-after-p i (- n i)))
3661 (overlay-put ov 'eglot--inlay-hint t) 3661 (overlay-put ov 'eglot--inlay-hint t)
3662 (overlay-put ov 'evaporate t) 3662 (overlay-put ov 'evaporate t)
3663 (overlay-put ov 'eglot--overlay t)))) 3663 (overlay-put ov 'eglot--overlay t))))
3664 (if (stringp label) (do-it label left-pad right-pad 0) 3664 (if (stringp label) (do-it label left-pad right-pad 0 1)
3665 (cl-loop 3665 (cl-loop
3666 for i from 0 for ldetail across label 3666 for i from 0 for ldetail across label
3667 do (eglot--dbind ((InlayHintLabelPart) value) ldetail 3667 do (eglot--dbind ((InlayHintLabelPart) value) ldetail
3668 (do-it value 3668 (do-it value
3669 (and (zerop i) left-pad) 3669 (and (zerop i) left-pad)
3670 (and (= i (1- (length label))) right-pad) 3670 (and (= i (1- (length label))) right-pad)
3671 i))))))))) 3671 i (length label))))))))))
3672 (jsonrpc-async-request 3672 (jsonrpc-async-request
3673 (eglot--current-server-or-lose) 3673 (eglot--current-server-or-lose)
3674 :textDocument/inlayHint 3674 :textDocument/inlayHint