diff --git a/build/main.js b/build/main.js index 2ad3a88..5ffd63a 100644 --- a/build/main.js +++ b/build/main.js @@ -32135,13 +32135,14 @@ exports['default'] = function (state, action) { function search(keywords) { if (!keywords) { var cwd = _store2['default'].getState().get('cwd'); - console.log(cwd); (0, _apiFiles.children)(cwd, true).then(function (files) { _store2['default'].dispatch((0, _actionsFilesView.listFiles)(files)); }, _utils.reportError); return ''; } - var keys = keywords.split(' '); + var keys = keywords.split(' ').map(function (key) { + return key.toLowerCase(); + }); // We don't want to show all the currently visible files from the // first iteration @@ -32158,10 +32159,11 @@ function search(keywords) { (0, _apiFiles.children)(path, true).then(showResults, _utils.reportError); } return keys.some(function (key) { - return file.name.indexOf(key) > -1; + return file.name.toLowerCase().indexOf(key) > -1; }); }); + if (!filtered.length) return; _store2['default'].dispatch((0, _actionsFilesView.listFiles)(current.concat(filtered))); }, _utils.reportError); } diff --git a/design/userinterface.sketch b/design/userinterface.sketch index fc621e6..6f8b36e 100644 Binary files a/design/userinterface.sketch and b/design/userinterface.sketch differ diff --git a/src/js/reducers/search.js b/src/js/reducers/search.js index 20d24cf..381521e 100644 --- a/src/js/reducers/search.js +++ b/src/js/reducers/search.js @@ -18,13 +18,12 @@ export default function(state = '', action) { function search(keywords) { if (!keywords) { let cwd = store.getState().get('cwd'); - console.log(cwd); children(cwd, true).then(files => { store.dispatch(listFiles(files)); }, reportError); return ''; } - let keys = keywords.split(' '); + let keys = keywords.split(' ').map(key => key.toLowerCase()); // We don't want to show all the currently visible files from the // first iteration @@ -41,10 +40,11 @@ function search(keywords) { children(path, true).then(showResults, reportError); } return keys.some(key => { - return file.name.indexOf(key) > -1; + return file.name.toLowerCase().indexOf(key) > -1; }); }); + if (!filtered.length) return; store.dispatch(listFiles(current.concat(filtered))); }, reportError); }