telescope.nvim
telescope.nvim copied to clipboard
feat(live_grep): Allow passing multiple file types for type_filter
Description
This PR allows passing multiple file types to type_filter in the live_grep builtin. Previously, only a single file type was allowed.
This implementation accepts a comma separated string (easier when using the :Telescope live_grep command) or a table of strings. It splits the input and passes it as multiple --type args to ripgrep.
Type of change
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration
- [x]
:Telescope live_grep type_filter=lua - [x]
:Telescope live_grep type_filter=lua,md - [x]
:lua require("telescope.builtin").live_grep({type_filter="lua"}) - [x]
:lua require("telescope.builtin").live_grep({type_filter={"lua","md"}})
Configuration:
- Neovim version (nvim --version):
v0.10.2 - Operating system and version: Arch Linux
Checklist:
- [x] My code follows the style guidelines of this project (stylua)
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation (lua annotations)