Skip to content

Commit

Permalink
treat empty object as self shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-zhening-luo committed Jan 29, 2025
1 parent fde935b commit cf6281b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ class Search extends Shortcut<
entry.separator,
entry.encodeComponent,
)
: "shortcut" in entry
? new Engine("shortcut", entry.shortcut, entry.notify)
: new Engine("find", entry.find);
: "find" in entry
? new Engine("find", entry.find)
: "shortcut" in entry
? new Engine("shortcut", entry.shortcut, entry.notify)
: new Engine("shortcut", "");

this.write(recomposed);

Expand Down
1 change: 1 addition & 0 deletions src/interface/search/setting.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SearchSetting {
alias: FieldTable;
engines: Table<
| Unflat<string, true>
| Record<string, never>
| SearchEngineSetting<"find">
| SearchEngineSetting<
"shortcut",
Expand Down

0 comments on commit cf6281b

Please sign in to comment.