From: João Távora Date: Sun, 16 Dec 2018 14:33:14 +0000 (+0000) Subject: Be more careful when making xref summaries X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~359 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=24a1a7ffeed8d2e4b45a29a51b0378a87584e562;p=emacs.git 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 --- 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)