Skip to content

Commit 452adb9

Browse files
nathansgithubjacobgkau
authored andcommitted
Stop immediately listing hidden files
1 parent 96e19b3 commit 452adb9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/tab.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ fn tab_complete(path: &Path) -> Result<Vec<(String, PathBuf)>, Box<dyn Error>> {
346346
let Some(file_name) = file_name_os.to_str() else {
347347
continue;
348348
};
349+
// Don't list hidden files before entering a pattern
350+
if pattern == "^" && file_name.starts_with('.') {
351+
continue;
352+
}
349353
if regex.is_match(file_name) {
350354
completions.push((file_name.to_string(), entry.path()));
351355
}

0 commit comments

Comments
 (0)