From e1679cd9a7b0ecf07634499323de9af53ec08205 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 11 Nov 2024 19:39:32 +0100 Subject: [PATCH] Update matches count when refreshing *xref* buffer --- lisp/progmodes/xref.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 221b715d850..7e9987d0cc9 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1233,6 +1233,7 @@ XREF-ALIST is of the form ((GROUP . (XREF ...)) ...), where GROUP is a string for decoration purposes and XREF is an `xref-item' object." (require 'compile) ; For the compilation faces. + (setq xref-num-matches-found 0) (cl-loop for (group . xrefs) in xref-alist for max-line = (cl-loop for xref in xrefs maximize (xref-location-line @@ -1252,6 +1253,7 @@ GROUP is a string for decoration purposes and XREF is an (xref--insert-propertized '(face xref-file-header xref-group t) group "\n") (dolist (xref xrefs) + (cl-incf xref-num-matches-found) (pcase-let (((cl-struct xref-item summary location) xref)) (let* ((line (xref-location-line location)) (prefix @@ -1357,7 +1359,6 @@ this variable to an alist with the following key-value pairs: (xref--ensure-default-directory dd (current-buffer)) (xref--xref-buffer-mode) (xref--show-common-initialize xref-alist fetcher (append xref-fetcher-alist alist)) - (setq xref-num-matches-found (length xrefs)) (setq mode-line-process (list xref-mode-line-matches)) (current-buffer)))) -- 2.39.5