diff options
author | Kevin Sjöberg | 2021-06-08 18:36:27 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-09 01:06:31 +0000 |
commit | b20e4a108cd890afa6cdf83656856fc2157a8e84 (patch) | |
tree | d3075941f75003970cd36a234dc8417ef1d79fbe /helix-term/src/ui | |
parent | 1bb9977fafc145448e4ea77f4cb3a132d1542bfa (diff) |
Only enforce limit outside of .git
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 44a3720b..7e4464bc 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -85,10 +85,15 @@ pub fn file_picker(root: PathBuf) -> Picker<PathBuf> { Err(_err) => None, }); - const MAX: usize = 8192; + let files = if root.join(".git").is_dir() { + files.collect() + } else { + const MAX: usize = 8192; + files.take(MAX).collect() + }; Picker::new( - files.take(MAX).collect(), + files, move |path: &PathBuf| { // format_fn path.strip_prefix(&root) |