From bc1a90d4f504077c413a0b99bfd0ae589fad6817 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 11 Dec 2012 13:40:58 +0100 Subject: [PATCH] file completion: disable ignored files when entered prefix matches. --- src/completion.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/completion.cc b/src/completion.cc index 793b67b2..7f9325fe 100644 --- a/src/completion.cc +++ b/src/completion.cc @@ -47,13 +47,16 @@ CandidateList complete_filename(const Context& context, if (not dir) return result; + const bool check_ignored_files = not ignored_files.empty() and + not boost::regex_match(fileprefix.c_str(), ignored_files_regex); + while (dirent* entry = readdir(dir)) { String filename = entry->d_name; if (filename.empty()) continue; - if (not ignored_files.empty() and + if (check_ignored_files and boost::regex_match(filename.c_str(), ignored_files_regex)) continue;