Remove directories from fuzzy-finder

This commit is contained in:
Corey Johnson & Kevin Sawicki 2012-12-12 17:25:45 -08:00
parent 6f6dfe78a9
commit a6a05b6ff4
4 changed files with 7 additions and 8 deletions

View File

@ -16,8 +16,8 @@ var $native = {};
native function traverseTree(path, onFile, onDirectory);
$native.traverseTree = traverseTree;
native function getAllPathsAsync(path, callback);
$native.getAllPathsAsync = getAllPathsAsync;
native function getAllFilePathsAsync(path, callback);
$native.getAllFilePathsAsync = getAllFilePathsAsync;
native function isFile(path);
$native.isFile = isFile;

View File

@ -103,7 +103,7 @@ bool Native::Execute(const CefString& name,
return true;
}
else if (name == "getAllPathsAsync") {
else if (name == "getAllFilePathsAsync") {
std::string argument = arguments[0]->GetStringValue().ToString();
CefRefPtr<CefV8Value> callback = arguments[1];
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
@ -127,8 +127,7 @@ bool Native::Execute(const CefString& name,
}
bool isFile = entry->fts_info == FTS_NSOK;
bool isDir = entry->fts_info == FTS_D;
if (!isFile && !isDir) {
if (!isFile) {
continue;
}

View File

@ -53,7 +53,7 @@ class Project
getFilePaths: ->
deferred = $.Deferred()
fs.getAllPathsAsync @getPath(), (paths) =>
fs.getAllFilePathsAsync @getPath(), (paths) =>
paths = paths.filter (path) => not @isPathIgnored(path)
deferred.resolve(paths)
deferred.promise()

View File

@ -112,8 +112,8 @@ module.exports =
@makeTree(@directory(path))
@makeDirectory(path)
getAllPathsAsync: (rootPath, callback) ->
$native.getAllPathsAsync(rootPath, callback)
getAllFilePathsAsync: (rootPath, callback) ->
$native.getAllFilePathsAsync(rootPath, callback)
traverseTree: (rootPath, onFile, onDirectory) ->
$native.traverseTree(rootPath, onFile, onDirectory)