-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement max_files option in a number of places
Unlike in the Ruby version, the Lua version allows you to set a different limit for each scanner, becauase different scanners have different performance characteristics. commandt.setup({ scanners = { file = { max_files = 100000, -- A "big" limit. }, find = { max_files = 10, -- A small limit. }, git = { max_files = 0, -- Same as no limit. }, rg = { -- No setting, no limit. }, } A subsequent commit will explain the details of how to set this up, but in brief, setting the limit to "0" (or omitting the limit) means no limit. If you have circular symlinks in a filesystem, then the limit stops Command-T for scanning forever (particularly in the case of the `:CommandT` — "find" — scanner). If you have a custom command-based scanner, then you can supply a "max_files" limit in your return value; eg. a limit of 10,000 like so: finders = { ack = { command = function(directory) local command = 'ack -f --print0' if directory ~= '' and directory ~= '.' and directory ~= './' then directory = vim.fn.shellescape(directory) command = command .. ' -- ' .. directory end local drop = 0 local max_files = 10000 return command, drop, max_files end, }, }, Disclaimer: this is only exceedingly lightly tested, so I'm going to park it on the "next" branch for a bit before merging to "main". Note: formatting changes due to running "bin/format" included.
- Loading branch information
Showing
14 changed files
with
155 additions
and
68 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
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
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
Oops, something went wrong.
660d241
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another pattern I am considering, because that can easily become unwieldy: