Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force --require-match in drun mode #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/config
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@

# If true, require a match to allow a selection to be made. If false,
# making a selection with no matches will print input to stdout.
# In drun mode, this is always true.
require-match = true

# If true, automatically accept a result if it is the only one
Expand Down
3 changes: 1 addition & 2 deletions doc/tofi.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ options.
**require-match**=*true\|false*

> If true, require a match to allow a selection to be made. If false,
> making a selection with no matches will print input to stdout. In drun
> mode, this is always true.
> making a selection with no matches will print input to stdout.
>
> Default: true

Expand Down
1 change: 0 additions & 1 deletion doc/tofi.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ options.
*require-match*=_true|false_
If true, require a match to allow a selection to be made. If false,
making a selection with no matches will print input to stdout.
In drun mode, this is always true.

Default: true

Expand Down
3 changes: 1 addition & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,7 @@ static bool do_submit(struct tofi *tofi)
char *res = entry->results.buf[selection].string;

if (tofi->window.entry.results.count == 0) {
/* Always require a match in drun mode. */
if (tofi->require_match || entry->mode == TOFI_MODE_DRUN) {
if (tofi->require_match) {
return false;
} else {
printf("%s\n", entry->input_utf8);
Expand Down