branch: externals/eglot
commit b8a890197329b4e8ebb4ecfba623e73f4fa35ba2
Author: João Távora <joaotav...@gmail.com>
Commit: João Távora <joaotav...@gmail.com>

    Fix #187: be more careful when making xref summaries
    
    * eglot.el (eglot--xref-make): Only highlight to end-of-line at
    most.
---
 eglot.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/eglot.el b/eglot.el
index ee40329..60dad45 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1667,8 +1667,10 @@ Try to visit the target file for a richer summary line."
                   (eglot--widening
                    (pcase-let* ((`(,beg . ,end) (eglot--range-region range))
                                 (bol (progn (goto-char beg) (point-at-bol)))
-                                (substring (buffer-substring bol 
(point-at-eol))))
-                     (add-face-text-property (- beg bol) (- end bol) 'highlight
+                                (substring (buffer-substring bol 
(point-at-eol)))
+                                (hi-beg (- beg bol))
+                                (hi-end (- (min (point-at-eol) end) bol)))
+                     (add-face-text-property hi-beg hi-end 'highlight
                                              t substring)
                      (list substring (1+ (current-line)) 
(eglot-current-column))))))
        (`(,summary ,line ,column)

Reply via email to