What did you expect to happen?
projectile-find-file and +default/search-cwd should list nested paths correctly.
What actually happened?
In Windows with mingw installed, this kind of output is displayed for both commands:

Additional details:
See this issue for details:
https://github.com/BurntSushi/ripgrep/issues/501#issuecomment-305960492
I fixed this issue with the following snippet:
(after! ivy
(when IS-WINDOWS
(setq counsel-rg-base-command "rg -M 240 --with-filename --no-heading --line-number --color never %s --path-separator // .")))
(after! projectile
(when (executable-find doom-projectile-fd-binary)
(setq projectile-generic-command
(concat (format "%s . -0 -H -E .git --color=never --type file --type symlink --follow"
doom-projectile-fd-binary)
(if IS-WINDOWS " --path-separator=//")))))
System information:
emacs version 26.2
features XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
build 4 13, 2019
buildopts (--without-dbus --host=x86_64-w64-mingw32 --without-compress-install 'CFLAGS=-O2 -static -g3')
windowsys w32
daemonp server-running
doom version 2.0.9
build HEAD -> develop, origin/develop, origin/HEAD a262527a7 2020-05-21 04:33:39 -0400
dir ~/.doom.d/
system type windows-nt
config x86_64-w64-mingw32
shell C:\Program Files\Git\usr\bin\bash.exe
uname n/a
path (C:\Users\kuzuki\bin C:\Program Files\Git\mingw64\bin C:\Program Files\Git\usr\local\bin C:\Program Files\Git\usr\bin C:\Program Files\Git\usr\bin C:\Program Files\Git\mingw64\bin C:\Program Files\Git\usr\bin C:\Users\kuzuki\bin C:\Program Files\ImageMagick-7.0.10-Q16 C:\Python27 C:\Python27\Scripts C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp C:\bin\ImageMagick C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0 C:\bin C:\Program Files\PuTTY C:\Program Files\Microsoft SQL Server\110\Tools\Binn C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common C:\Program Files (x86)\LuaRocks C:\Program Files\LOVE C:\bin\Ruby26-x64\bin C:\bin\emacs-26.2\bin C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0 C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\WINDOWS\System32\WindowsPowerShell\v1.0 C:\WINDOWS\System32\OpenSSH C:\Program Files (x86)\arbtt\bin C:\Program Files\TortoiseHg C:\bin\nodejs C:\ProgramData\chocolatey\bin C:\Program Files\dotnet C:\Program Files\Microsoft SQL Server\130\Tools\Binn C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn C:\Program Files\CMake\bin C:\Program Files\Microsoft SQL Server\120\Tools\Binn C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn C:\Program Files\Microsoft SQL Server\100\Tools\Binn C:\Program Files\Microsoft SQL Server\100\DTS\Binn C:\Program Files (x86)\Common Files\GTK\2.0\bin C:\Program Files\Zulu\zulu-13-jre\bin C:\bin\graphviz\bin C:\bin\luajit\bin C:\Program Files\Git\cmd C:\Users\kuzuki\.cargo\bin C:\Program Files (x86)\Nmap C:\Users\kuzuki\AppData\Local\Microsoft\WindowsApps C:\bin\Ruby26-x64\bin C:\Program Files (x86)\FlacSquisher C:\bin\vgmstream C:\bin\hsp351 C:\Users\kuzuki\AppData\Local\Programs\Microsoft VS Code\bin C:\Users\kuzuki\AppData\Roaming\npm C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\bin C:\Users\kuzuki\MacOS9\GTK\2.0\bin C:\bin\graphviz\bin C:\bin\luajit\src C:\Program Files\smartmontools\bin C:\Users\kuzuki\build\doom-emacs\bin C:\Program Files\Git\usr\bin\vendor_perl C:\Program Files\Git\usr\bin\core_perl c:/bin/emacs-26.2/libexec/emacs/26.2/x86_64-w64-mingw32/)
config envfile envvar-file
elc-files 0
modules (:input japanese :completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) vc-gutter vi-tilde-fringe workspaces :editor (evil +everywhere) file-templates fold snippets :emacs dired electric undo vc :checkers syntax :tools (eval +overlay) lookup lsp magit :lang emacs-lisp lua markdown org sh :config (default +bindings +smartparens))
packages ((lispyville))
unpin (n/a)
elpa (n/a)
Is this a universal solution (for all Windows users)? Do we need to detect mingw running bash vs mingw _not_ running bash?
And if this _is_ a universal solution, should it (at least the counsel-rg-base-command fix) be reported to counsel?
It has been reported to counsel, but it's blocked on a large-scale refactoring.
abo-abo/swiper#2351
@Ruin0x11, thank you for the snippet you've provided, I'm new to doom-emacs and it is essential for me to use it across different systems including Windows.
GNU Emacs 26.1
Windows10 1809
Ack, I linked the wrong issue. Ah well, this should be fixed in f548ab6. I'll leave this open until it is addressed upstream.
You should add MSYS2_ARG_CONV_EXCL=--path-separator= in to your environment.
See https://github.com/sharkdp/fd/issues/537#issuecomment-636422669
Ack, I linked the wrong issue. Ah well, this should be fixed in f548ab6. I'll leave this open until it is addressed upstream.
This commit breaks things for me.
Before that +default/search-project worked without any problem. Now the same command gives an empty result with
error code 2
I bisected the commits and that is the one responsible
Actually, further investigation shows that the new rg command is invalid under windows:
C:\Users\guraltsev\.config>rg --path-separator // test
A path separator must be exactly one byte, but the given separator is 2 bytes: //
In some shells on Windows '/' is automatically expanded. Use '//' instead.
while
C:\Users\guraltsev\.config>rg --path-separator / test
works perfectly.
I have the latest rg for windows:
C:\Users\guraltsev\.config>rg --version
ripgrep 12.1.1 (rev 7cb211378a)
-SIMD -AVX (compiled)
@hlissner
Is this a universal solution (for all Windows users)? Do we need to detect mingw running bash vs mingw _not_ running bash?
Apparently not. Running
rg --path-separator / test
works in CMD but not in a mingw shell
while works in mingw
rg --path-separator // test
but not in a standard cmd prompt.
Just want to comment that in a similar fashion I had to change the --path-separator // that gets set for counsel-rg-base-command somewhere to use a single /.
(if (eq system-type 'windows-nt)
(setq counsel-rg-base-command
"rg -M 240 --with-filename --no-heading --line-number --color never %s --path-separator / ."))
Also using Windows 10 and probably (?) standard cmd shell.
If you do not want to rewrite the whole command (that is actually a list), here is the code I use
(after! ivy
(let* ((counsel-rg counsel-rg-base-command)
(post-path-sep (member "--path-separator" counsel-rg)))
(when post-path-sep
(setcdr post-path-sep (cons "/" (cddr post-path-sep)))
(setq counsel-rg-base-command counsel-rg))))
None of the above methods worked for me - ripgrep straight up refused to work (or rather, mingw? didn't really understand who's the bad guy), neither with "/" nor with "//". After realizing I haven't gotten any work done for an hour already, I gave up and opted for projectile's native indexing in elisp:
(setq projectile-indexing-method 'native)
Not a Windows user, so I can't do extensive testing on this. Can anyone recommend a workaround (perhaps to detect whenever // is necessary)? Or am I forced to always throw one group of users under the bus? If so, any insight into which use case is more common for Emacs users on Windows?
Can't speak in general, but on my work PC the suggestion from @guraltsev works wonders.
I just added the snippet from https://github.com/hlissner/doom-emacs/issues/3215#issuecomment-641581336 to my .doom.d/config.el and can use ripgrep as is from dooms default configuration.
PC config:
ripgrep and emacs installed via scoop
only the snippet from @guraltsev in my config.el
Can't speak in general, but on my work PC the suggestion from @guraltsev works wonders.
That's not quite what I was asking for. I meant a fix to determine whether --path-separator / or --path-separator // is necessary at call time. Guraltsev's solution is to replace one with the other, once and globally, but that doesn't solve the issue for users for whom that setting is necessary for it to work.
Agree, the more general solution is to use the MSYS2_ARG_CONV_EXCL=--path-separator= environment as I said above.
@chuxubank Ah, I missed that. That's perfect. I'll look into incorporating that into Doom soon. Thanks!
As of 523e945 this issue should be resolved. Let me know if that isn't the case and I'll reopen it.
@hlissner since this change I am getting an error when trying to switch projects. Looks to be around the change for file-remote-p function call?
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
find-file-name-handler(nil file-remote-p)
file-remote-p(nil nil t)
(if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary)
(and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary))
(let* ((bin (and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn (list "fdfind" "fd")) doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))
(cond ((let* ((bin (and t (if (file-remote-p buffer-file-name nil t) (cl-find-if find-exe-fn ...) doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* ((--cl-var-- projectile-globally-ignored-directories) (dir nil) (--cl-var-- "")) (while (consp --cl-var--) (setq dir (car --cl-var--)) (setq --cl-var-- (concat --cl-var-- " --glob ")) (setq --cl-var-- (concat --cl-var-- (shell-quote-argument ...))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0"))
(let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin (and t (if ... ... doom-projectile-fd-binary)))) (if bin (concat (format "%s . -0 -H -E .git --color=never --type file --typ..." bin) (if IS-WINDOWS " --path-separator=/")) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* ((--cl-var-- projectile-globally-ignored-directories) (dir nil) (--cl-var-- "")) (while (consp --cl-var--) (setq dir (car --cl-var--)) (setq --cl-var-- (concat --cl-var-- " --glob ")) (setq --cl-var-- (concat --cl-var-- ...)) (setq --cl-var-- (cdr --cl-var--))) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0")))
(closure (t) (_) (let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin ...)) (if bin (concat ... ...) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* (... ... ...) (while ... ... ... ... ...) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0"))))(git)
funcall((closure (t) (_) (let ((find-exe-fn (if EMACS27+ (doom-rpartial #'executable-find t) #'executable-find))) (cond ((let* ((bin ...)) (if bin (concat ... ...) nil))) ((funcall find-exe-fn "rg") (concat "rg -0 --files --follow --color=never --hidden" (let* (... ... ...) (while ... ... ... ... ...) --cl-var--) (if IS-WINDOWS " --path-separator /"))) ("find . -type f -print0")))) git)
(if (functionp projectile-generic-command) (funcall projectile-generic-command vcs) projectile-generic-command)
doom--only-use-generic-command-a(git)
apply(doom--only-use-generic-command-a git)
projectile-get-ext-command(git)
projectile-dir-files-alien("/Users/jsmestad/code/headsdown/app/")
projectile-dir-files("/Users/jsmestad/code/headsdown/app/")
#f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>)("/Users/jsmestad/code/headsdown/app/")
mapcan(#f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>) ("/Users/jsmestad/code/headsdown/app/"))
cl-mapcan(#f(compiled-function (dir) #<bytecode 0xf8036c2177f509f>) ("/Users/jsmestad/code/headsdown/app/"))
projectile-project-files("/Users/jsmestad/code/headsdown/app/")
projectile-current-project-files()
counsel-projectile-find-file(nil)
funcall-interactively(counsel-projectile-find-file nil)
call-interactively(counsel-projectile-find-file)
(cond ((and projectile-project-root (file-equal-p projectile-project-root default-directory)) (if (doom-project-p default-directory) nil (setq projectile-enable-caching nil)) (call-interactively (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) ((fboundp 'counsel-file-jump) (call-interactively #'counsel-file-jump)) ((project-current) (project-find-file-in nil (list default-directory) nil)) ((fboundp 'helm-find-files) (call-interactively #'helm-find-files)) ((call-interactively #'find-file)))
(let* ((default-directory (file-truename (expand-file-name dir))) (projectile-project-root (doom-project-root default-directory)) (projectile-enable-caching projectile-enable-caching)) (cond ((and projectile-project-root (file-equal-p projectile-project-root default-directory)) (if (doom-project-p default-directory) nil (setq projectile-enable-caching nil)) (call-interactively (if (doom-module-p :completion 'ivy) #'counsel-projectile-find-file #'projectile-find-file))) ((fboundp 'counsel-file-jump) (call-interactively #'counsel-file-jump)) ((project-current) (project-find-file-in nil (list default-directory) nil)) ((fboundp 'helm-find-files) (call-interactively #'helm-find-files)) ((call-interactively #'find-file))))
doom-project-find-file("~/code/headsdown/app/")
funcall(doom-project-find-file "~/code/headsdown/app/")
(if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))
(if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ((project-name (doom-project-name +workspaces--project-dir))) (or (+workspace-get project-name t) (+workspace-new project-name)))) (new-name (progn (progn (aref persp 1))))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)))
(unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ((project-name ...)) (or (+workspace-get project-name t) (+workspace-new project-name)))) (new-name (progn (progn (aref persp 1))))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil))
(progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (run-hooks ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name (get-current-persp)) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let (...) (or ... ...))) (new-name (progn (progn ...)))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil)))
(if (and persp-mode +workspaces--project-dir) (progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...)))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal (safe-persp-name ...) persp-nil-name) (+workspace-buffer-list))) (let* ((persp (let ... ...)) (new-name (progn ...))) (+workspace-switch new-name) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil))))
(let (projectile-project-root) (if (and persp-mode +workspaces--project-dir) (progn (if projectile-before-switch-project-hook (progn (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))))) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) (equal ... persp-nil-name) (+workspace-buffer-list))) (let* ((persp ...) (new-name ...)) (+workspace-switch new-name) (save-current-buffer (set-buffer ...) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir)) (+workspace-message (format "Switched to '%s' in new workspace" new-name) 'success)) (save-current-buffer (set-buffer (doom-fallback-buffer)) (setq default-directory +workspaces--project-dir) (hack-dir-local-variables-non-file-buffer) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir))) (condition-case err (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir)) ((debug error) (message "Workspace error: %s" err) nil)) (if current-prefix-arg nil (funcall +workspaces-switch-project-function +workspaces--project-dir))) (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil)))))
+workspaces-switch-to-project-h("~/code/headsdown/app/")
ivy-call()
#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b52ab6db99ed806>)("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action ...)) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project :sort t)
apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1b52ab6db99ed806>) ("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action ...)) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project :sort t))
ivy-read("[app] Switch to project: " ("~/code/headsdown/app/" "~/org/" "~/.emacs-doom.d/" "~/code/self/justinsmestad-static/") :preselect "~/code/headsdown/app/" :action (1 ("o" +workspaces-switch-to-project-h "open project in new workspace") ("O" counsel-projectile-switch-project-action "jump to a project buffer or file") ("f" counsel-projectile-switch-project-action-find-file "jump to a project file") ("d" counsel-projectile-switch-project-action-find-dir "jump to a project directory") ("b" counsel-projectile-switch-project-action-switch-to-buffer "jump to a project buffer") ("m" counsel-projectile-switch-project-action-find-file-manually "find file manually from project root") ("w" counsel-projectile-switch-project-action-save-all-buffers "save all project buffers") ("k" counsel-projectile-switch-project-action-kill-buffers "kill all project buffers") ("r" counsel-projectile-switch-project-action-remove-known-project "remove project from known projects") ("c" counsel-projectile-switch-project-action-compile "run project compilation command") ("C" counsel-projectile-switch-project-action-configure "run project configure command") ("e" counsel-projectile-switch-project-action-edit-dir-locals "edit project dir-locals") ("v" counsel-projectile-switch-project-action-vc "open project in vc-dir / magit / monky") ("s" (lambda (project) (let ((projectile-switch-project-action (lambda nil ...))) (counsel-projectile-switch-project-by-name project))) "search project") ("xs" counsel-projectile-switch-project-action-run-shell "invoke shell from project root") ("xe" counsel-projectile-switch-project-action-run-eshell "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project")) :require-match t :sort nil :caller counsel-projectile-switch-project)
counsel-projectile-switch-project()
funcall-interactively(counsel-projectile-switch-project)
call-interactively(counsel-projectile-switch-project nil nil)
command-execute(counsel-projectile-switch-project)
@jsmestad Not sure if you noticed, but 4205f1bbeae4 and da1030985d4c should've resolved that issue.
I am still experiencing this bug on Windows 10. Setting the path separator to a single slash resolves it. rg installed via scoop.
@hliebert Are you sure you've updated Doom? It is already set to a single slash.
This was on a new install, I got a new windows laptop from work. I had installed it the day before I posted.
@hlissner Just tested and can confirm this still occurs on the latest doom.
Doom v2.0.9 (ffbd7b63bf7290b6cd6fc3f1b41110876864fe83)
Emacs v26.3
Branch: develop
Build date: 2020-08-02 01:33:51 -0400
Edit: Apparently the default value is changed somewhere.
counsel-rg-base-command is a variable defined in counsel.el.
Value
("rg" "-M" "240" "--with-filename" "--no-heading" "--line-number" "--color" "never" "%s" "--path-separator" "//" ".")
Original Value
("rg" "-M" "240" "--with-filename" "--no-heading" "--line-number" "--color" "never" "%s" "--path-separator" "/" ".")
Same story for me as @hliebert, latest Doom, Emacs and rg installed via scoop, and the original value for counsel-rg-base-command is being changed somewhere to use 2 slashes
Try 8024f4e. Should hopefully fix this.
Working perfectly, thanks @hlissner!
Most helpful comment
Try 8024f4e. Should hopefully fix this.