1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Fixes #176 add mode that user expects.

This commit is contained in:
QC 2015-06-11 20:38:48 +02:00
parent 18c53720f0
commit d11c61cef1
3 changed files with 21 additions and 2 deletions

View file

@ -515,6 +515,11 @@ The following options are further explained in the theming section:
Only return a selected item, do not allow custom entry.
This mode always returns an entry, or returns directly when no entries given.
`-no-custom`
Only return a selected item, do not allow custom entry.
This mode returns directly when no entries given.
`-format` *format*
Allows the output of dmenu to be customized (N is total number of input entries):

View file

@ -921,6 +921,20 @@ This mode always returns an entry, or returns directly when no entries given\.
.IP "" 0
.
.P
\fB\-no\-custom\fR
.
.IP "" 4
.
.nf
Only return a selected item, do not allow custom entry\.
This mode returns directly when no entries given\.
.
.fi
.
.IP "" 0
.
.P
\fB\-format\fR \fIformat\fR
.
.IP "" 4

View file

@ -217,7 +217,7 @@ int dmenu_switcher_dialog ( char **input )
}
int only_selected = FALSE;
if ( find_arg ( "-only-match" ) >= 0 ) {
if ( find_arg ( "-only-match" ) >= 0 || find_arg ( "-no-custom" ) ) {
only_selected = TRUE;
if ( length == 0 ) {
return TRUE;
@ -248,7 +248,7 @@ int dmenu_switcher_dialog ( char **input )
/**
* Select item mode.
*/
restart = TRUE;
restart = ( find_arg ( "-only-match" ) >= 0 );
if ( ( mretv & ( MENU_OK | MENU_QUICK_SWITCH ) ) && list[selected_line] != NULL ) {
dmenu_output_formatted_line ( format, list[selected_line], selected_line, *input );
retv = TRUE;