From a6a05b6ff460af9e8c8deb17ea141c0b4e8904ae Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Wed, 12 Dec 2012 17:25:45 -0800 Subject: [PATCH] Remove directories from fuzzy-finder --- native/v8_extensions/native.js | 4 ++-- native/v8_extensions/native.mm | 5 ++--- src/app/project.coffee | 2 +- src/stdlib/fs.coffee | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/native/v8_extensions/native.js b/native/v8_extensions/native.js index 6e17b135e..85cdf5be8 100644 --- a/native/v8_extensions/native.js +++ b/native/v8_extensions/native.js @@ -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; diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 229993ab3..b63f9a2f9 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -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 callback = arguments[1]; CefRefPtr 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; } diff --git a/src/app/project.coffee b/src/app/project.coffee index 634b0ecf3..2d48851f5 100644 --- a/src/app/project.coffee +++ b/src/app/project.coffee @@ -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() diff --git a/src/stdlib/fs.coffee b/src/stdlib/fs.coffee index 696dd8036..59a034984 100644 --- a/src/stdlib/fs.coffee +++ b/src/stdlib/fs.coffee @@ -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)