Skip to content

[Bug] find_args not applied correctly when using fd/fdfind #806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ray-x opened this issue Mar 13, 2023 · 2 comments · Fixed by #815
Closed

[Bug] find_args not applied correctly when using fd/fdfind #806

ray-x opened this issue Mar 13, 2023 · 2 comments · Fixed by #815

Comments

@ray-x
Copy link

ray-x commented Mar 13, 2023

#86

Issue existed in 2.x branch

Suppose I using this setup

{
  ...
    filesystem = {
      find_command = "fd", -- this is determined automatically, you probably don't need to set it
      find_args = { -- you can specify extra args to pass to the find command.
        fd = {
          '--exclude',
          '.git',
          '--exclude',
          'node_modules',
          '--exclude',
          'site-packages',
          '--exclude',
          'vendor',
        },
      },
   },
   ...
}

When expanded the arguments (search ses) , the arguments are

 { "--hidden", "--no-ignore", "--color", "never", "--max-results", 50, 
"--glob", "--", "*ses*", "/home/ray/Downloads", "--exclude", ".git", 
"--exclude", "node_modules", "--exclude", "site-packages", 
"--exclude", "vendor" }

Which is incorrect
It should be

 { "--hidden", "--no-ignore", "--color", "never", "--max-results", 50, 
"--exclude", ".git", "--exclude", "node_modules", "--exclude",
"site-packages", "--exclude", "vendor"  "--glob", "--", "*ses*",  
"/home/ray/Downloads"}

The position of -- is incorrect.
For most shell command we can not add any arguments start with - after --.

Also, another issue is

        hide_gitignored = false,

I want to show files ignored by git. But this setup adds "--no-ignore", this option ignores .gitignore, .git/info/exclude, .ignore and .fdignore setup. In my setup, those ignored files are different.
I would suggest adding fd_no_ignore

@cseickel
Copy link
Contributor

@ray-x I think I fixed this, can you try again using the main branch?

@ray-x
Copy link
Author

ray-x commented Mar 18, 2023

looks good to me, the arg list is

 "--hidden", "--no-ignore", "--color", "never", "--max-results", 50, "--glob", "--exclude", ".git", "--exclude", "node_modules", "--exclude", "site-packages", "--exclude", "vendor", "--", "*ven*", "/home/ray/go/src/github.com/ray-x/lsp_test/go"

@ray-x ray-x closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants