diff options
author | Alex Kladov | 2022-12-17 19:30:43 +0000 |
---|---|---|
committer | GitHub | 2022-12-17 19:30:43 +0000 |
commit | e6a2df8c798537a7dc5aff264eeccc773525aa6c (patch) | |
tree | d9f2afe510d7e0d8b9a0c413745a18947d746e62 /helix-term/src/ui/mod.rs | |
parent | b12c65678aacc577b070c70307ef6fce528e4d85 (diff) |
Better sorting in picker in case of ties (#5169)
Diffstat (limited to 'helix-term/src/ui/mod.rs')
-rw-r--r-- | helix-term/src/ui/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 5b5924bf..ade1d8cf 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -207,13 +207,14 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi // Cap the number of files if we aren't in a git project, preventing // hangs when using the picker in your home directory - let files: Vec<_> = if root.join(".git").exists() { + let mut files: Vec<PathBuf> = if root.join(".git").exists() { files.collect() } else { // const MAX: usize = 8192; const MAX: usize = 100_000; files.take(MAX).collect() }; + files.sort(); log::debug!("file_picker init {:?}", Instant::now().duration_since(now)); |