]> git.eshelyaron.com Git - emacs.git/commitdiff
Update matches count when refreshing *xref* buffer
authorEshel Yaron <me@eshelyaron.com>
Mon, 11 Nov 2024 18:39:32 +0000 (19:39 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 11 Nov 2024 18:39:32 +0000 (19:39 +0100)
lisp/progmodes/xref.el

index 221b715d850e06e3b294f79987527551f74c4e02..7e9987d0cc94849dc7162d0b5b55c98cc16560f3 100644 (file)
@@ -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))))