From 0f364c140da75dfb9245f9d0e2d52cdce0ff2004 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sun, 27 Oct 2024 15:05:01 +0000 Subject: [PATCH] fix: add no require git to rg command backend Summary: When using this backend in a directory that is not a git repository, it will search though all the file. This is mostly a problem when using an alternative source control like sapling. When using this backend neovim will just hang until the rg command is done. When searching node_modules you can imagine how long that takes. This does not actually fix the issue however, it does make it search though less files. Test Plan: This has been used manually on a sapling repo. I have also added `--no-require-git` to most of the rg defaults in other applications. --- lua/ivy/backends/rg.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ivy/backends/rg.lua b/lua/ivy/backends/rg.lua index 56d9921..5b76c9b 100644 --- a/lua/ivy/backends/rg.lua +++ b/lua/ivy/backends/rg.lua @@ -5,7 +5,7 @@ local rg = { command = "IvyRg", description = "Run ripgrep to search for content in files", keymap = "/", - items = utils.command_finder "rg --vimgrep --", + items = utils.command_finder "rg --no-require-git --max-columns 200 --vimgrep --", callback = utils.vimgrep_action(), }