forked from niuiic/blink-cmp-rg.nvim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: option ignore_paths to avoid running on certain paths (#105)
Issue ===== It's not possible to not search with blink-ripgrep.nvim while maintaining the ability to search with ripgrep (outside of Neovim). Although ripgrep supports many ways of ignoring paths, and blink-ripgrep is affected by those, they will always affect both ripgrep and blink-ripgrep at the same time. Users cannot maintain the ability to search with ripgrep in the terminal and use blink-ripgrep in Neovim at the same time. Solution ======== Add a new option `ignore_paths` to the configuration of blink-ripgrep. These can be set to absolute paths (resolved by `project_root_marker`). When a search is started, the plugin will check if the root path is ignored, and will not search if that's the case. BREAKING CHANGE: The `get_command` function, which provides a custom way to generate the entire ripgrep command, must now return a table with the command and the root path. --------- Co-authored-by: Mika Vilpas <mika.vilpas@gmail.com>
- Loading branch information
1 parent
f9f5624
commit 0882f96
Showing
6 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
integration-tests/test-environment/config-modifications/set_ignore_paths.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
---@param paths string[] | ||
function _G.set_ignore_paths(paths) | ||
require("blink-ripgrep").setup({ | ||
ignore_paths = paths, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters