From 53f5a07bebbf9fc880de88c8624ce3ed974b48ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 30 Aug 2025 11:43:41 +0100 Subject: [PATCH] Eglot: fix likely off-by-1 in LabelOffsetSupport feature (bug#79259) This feature was tweaked and last tested with a 2019 edition of the 'ccls' LSP. The spec does not clearly specify this number to be 0-indexed, but it would make sense that it would be so. So there's not need to 1+ - correct the numbers at all before using them in substring. This would fix the Haskell server use of this feature (which is bug#79259) * lisp/progmodes/eglot.el (eglot--sig-info): Fix likely off-by-1. --- 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 ee76d2fd5e4..475b5e13f1b 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3718,7 +3718,7 @@ for which LSP on-type-formatting should be requested." (let ((case-fold-search nil)) (and (search-forward parlabel (line-end-position) t) (list (match-beginning 0) (match-end 0)))) - (mapcar #'1+ (append parlabel nil))))) + (list (aref parlabel 0) (aref parlabel 1))))) (if (and beg end) (add-face-text-property beg end