Skip to content

Commit

Permalink
Create new note if none found in full text search
Browse files Browse the repository at this point in the history
  • Loading branch information
sballin committed Nov 21, 2020
1 parent b98b36c commit 0fca41e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,8 @@ Required Setup
Environment Variables
---------------------
searchFolders: 1 = return all notes from any folder matching the search query, 0 = don't
sortByDate: 1 = most recently modified note first, 0 = alphabetical order</string>
- searchFolders: 1 = return all notes from any folder matching the search query, 0 = don't
- sortByDate: 1 = most recently modified note first, 0 = alphabetical order</string>
<key>uidata</key>
<dict>
<key>060809AF-8160-439A-85F9-D672664E3A1A</key>
Expand Down Expand Up @@ -683,7 +682,7 @@ or create note</string>
<string>1</string>
</dict>
<key>version</key>
<string>3.1.2</string>
<string>3.1.3</string>
<key>webaddress</key>
<string>https://github.com/sballin/alfred-search-notes-app</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion search_notes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func main() {
searchRows, err := litedb.GetResults(userQuery.WordString, scope)
PanicOnErr(err)

if scope == "title" && len(searchRows) == 0 {
if (scope == "title" || scope == "body") && len(searchRows) == 0 {
createItem, err := CreateNoteItem(userQuery)
PanicOnErr(err)
alfred.Add(*createItem)
Expand Down

0 comments on commit 0fca41e

Please sign in to comment.