Skip to content

Commit

Permalink
Show all emoji if no search string is provided
Browse files Browse the repository at this point in the history
Alfred ranks script input results by most frequently used, so this seems like it would actually be useful. Type `emoji` to see the last couple emoji that were used.
  • Loading branch information
meyer committed Mar 27, 2017
1 parent a0b324d commit 6351f23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def codepoints_to_emoji(arr); arr.map(&:to_i).pack('U*'); end
query = ARGV.join(' ').downcase.strip
STDERR.puts "QUERY: `#{query}`"

if query.strip != ''
if query.strip == ''
# show everything if no query is provided
matches = EMOJIS['db'].keys
else
EMOJIS['search_strings'].each do |key, ss|
if ss.include?(" #{query} ")
exact_matches.push key
Expand Down
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<key>alfredfiltersresults</key>
<false/>
<key>argumenttype</key>
<integer>0</integer>
<integer>1</integer>
<key>escaping</key>
<integer>0</integer>
<key>keyword</key>
Expand Down

0 comments on commit 6351f23

Please sign in to comment.