[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult 337d8e9 2/4: consult-imenu--project-buffers: Us

From: ELPA Syncer
Subject: [elpa] externals/consult 337d8e9 2/4: consult-imenu--project-buffers: Use better project check
Date: Sun, 25 Jul 2021 15:57:07 -0400 (EDT)

branch: externals/consult
commit 337d8e9488e1b0dc63e07d603ddcd86b5add0dcb
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult-imenu--project-buffers: Use better project check
    Works also for buffers which are not backed by a file.
 consult-imenu.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/consult-imenu.el b/consult-imenu.el
index 26e0ea7..7b6f343 100644
--- a/consult-imenu.el
+++ b/consult-imenu.el
@@ -147,9 +147,9 @@ TYPES is the mode-specific types configuration."
   "Return project buffers with the same `major-mode' as the current buffer."
   (if-let (root (consult--project-root))
       (seq-filter (lambda (buf)
-                    (when-let (file (buffer-file-name buf))
+                    (when-let (dir (buffer-local-value 'default-directory buf))
                       (and (eq (buffer-local-value 'major-mode buf) major-mode)
-                           (string-prefix-p root file))))
+                           (string-prefix-p root (expand-file-name dir)))))
     (list (current-buffer))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]