Match directory before looking at included files.

This commit is contained in:
Peter Elmers 2018-02-06 10:53:31 -08:00 committed by Jacob Dufault
parent 4c32c2bf77
commit 47a8f20b20

View File

@ -161,6 +161,10 @@ void IncludeComplete::InsertIncludesFromDirectory(std::string directory,
bool use_angle_brackets) {
directory = NormalizePath(directory);
EnsureEndsInSlash(directory);
if (match_ && !match_->IsMatch(directory)) {
// Don't even enter the directory if it fails the patterns.
return;
}
std::vector<CompletionCandidate> results;
GetFilesInFolder(