Skip to content

counsel-rg ivy-occur is broken on Windows #1817

@mookid

Description

@mookid

At least on windows, jumping to a match does not work anymore on master.

To reproduce:
in the swiper repo, searching for cl-delete yields the following ivy-occur buffer:

-*- mode:grep; default-directory: "~/src/swiper/" -*-


5 candidates:
    .\counsel.el:1610:              (or (cl-delete default-directory (counsel-git-worktree-list)
    .\counsel.el:3533:    (set sym (cl-delete-duplicates
    .\counsel.el:3534:              (cl-delete-if-not counsel-yank-pop-filter (symbol-value sym))
    .\counsel.el:3565:    (set sym (cl-delete s (symbol-value sym)
    .\ivy.el:280:                   (cl-delete-duplicates

As a consequence, pressing RET fails to jump to the match.
A minimal patch to work around the issue is the following:

--- a/ivy.el
+++ b/ivy.el
@@ -4119,7 +4119,7 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
        highlight
        help-echo "mouse-1: call ivy-action")
      str)
-    (insert (if (string-prefix-p "./" str) "" "    ")
+    (insert (if (or (string-prefix-p "./" str) (string-prefix-p ".\\" str)) "" "     ")
             str ?\n))
   (goto-char (point-min))
   (forward-line 4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions