Subject: bug#79259: [PATCH] Fix arg doc off-by-one bug of eglot signature help

From: Lin Jian <[email-masked]>
Date: Sun, 17 Aug 2025 05:48:14 +0800

Tags: patch

`parlabel' is 0-indexed.  Arguments of `substring' are also
0-indexed.  No need to add 1 to `parlabel' before passing it to
`substring'.

>From 11328dd7a9d9777700b2682a3ce568e7a268d1a0 Mon Sep 17 00:00:00 2001
From: Lin Jian <[email-masked]>
Date: Sun, 17 Aug 2025 05:03:46 +0800
Subject: [PATCH] Fix arg doc off-by-one bug of eglot signature help

* lisp/progmodes/eglot.el (eglot--sig-info): Fix argument
documentation off-by-one bug of eglot signature help.

Copyright-paperwork-exempt: yes
---
 lisp/progmodes/eglot.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 4a7c525003c..0ddcb6cd09d 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3736,7 +3736,7 @@ for which LSP on-type-formatting should be requested."
              (insert "\n  "
                      (propertize
                       (if (stringp parlabel) parlabel
-                        (apply #'substring siglabel (mapcar #'1+ parlabel)))
+                        (apply #'substring siglabel (append parlabel nil)))
                       'face (and (eq i active-param) 'eldoc-highlight-function-argument))
                      ": " fpardoc)))))
       (buffer-string))))
-- 
2.49.0