Skip to content

Commit deda2d8

Browse files
committed
Change behavior to list all projects by default if there’s no search param.
1 parent 6a241c6 commit deda2d8

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.0.4] - 2024-09-13
99

1010
### Changed
1111

1212
- Reduced minimum search requirement to a single character.
1313
- Added a slight input delay to smooth out processing.
14+
- Typing `src` without a space or any argument—or just a bunch of spaces—now lists all folders by default.
1415

1516
## [0.0.3] - 2024-09-13
1617

info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
<key>type</key>
139139
<integer>5</integer>
140140
<key>withspace</key>
141-
<true/>
141+
<false/>
142142
</dict>
143143
<key>type</key>
144144
<string>alfred.workflow.input.scriptfilter</string>

search.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
$workflow = new Workflow();
99
$workflow->logger()->info('PHP version: '.phpversion());
1010

11-
if (! $workflow->argument()) {
12-
return;
13-
}
14-
1511
if (empty($workflow->env('SEARCH_PATHS'))) {
1612
return;
1713
}
@@ -52,9 +48,21 @@
5248
'threshold' => 0.3,
5349
]);
5450

55-
// Rock and roll
56-
$results = $fuse->search($workflow->argument());
57-
$workflow->logger()->info('Matching results: '.count($results));
51+
$keyword = trim($workflow->argument() ?? '');
52+
53+
if (empty($keyword)) {
54+
$results = [];
55+
56+
foreach ($fuse->getCollection() as $item) {
57+
$results[] = [
58+
'item' => $item,
59+
];
60+
}
61+
} else {
62+
// Rock and roll
63+
$results = $fuse->search($keyword);
64+
$workflow->logger()->info('Matching results: '.count($results));
65+
}
5866

5967
foreach ($results as $result) {
6068
$workflow->item()

0 commit comments

Comments
 (0)