From 24a1a7ffeed8d2e4b45a29a51b0378a87584e562 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 16 Dec 2018 14:33:14 +0000 Subject: [PATCH] Be more careful when making xref summaries * eglot.el (eglot--xref-make): Only highlight to end-of-line at most. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/187 --- lisp/progmodes/eglot.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ee40329ca1b..60dad452d68 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/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) -- 2.39.2