summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-02-17 08:44:51 +0100
committerDave Davenport <qball@gmpclient.org>2016-02-17 08:46:22 +0100
commit99515f986e941a40948f3fca37713e0758c9a1c5 (patch)
tree979b23c00ed9480f90c25c359d29c81f7cbc6865
parentd4d7ed70c2784fbad2998e51f39a5f8a30ce12d2 (diff)
Fix issue #281
if one entry as input and autoselect enabled return immediately
-rw-r--r--Changelog2
-rw-r--r--source/dialogs/dmenu.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index b3b01494..a8798032 100644
--- a/Changelog
+++ b/Changelog
@@ -5,6 +5,8 @@
- Blinking cursor.
- Config file.
- Add history to DRun mode. (#343)
+ Improvements:
+ - auto-select and single item on dmenu (#281)
Bug fixes:
- Fix subpixel rendering. (#303)
- Fix basic tests on OpenBSD (#272)
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index 6362c251..d76b0816 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -379,6 +379,10 @@ int dmenu_switcher_dialog ( void )
return TRUE;
}
}
+ if ( config.auto_select && cmd_list_length == 1 ) {
+ dmenu_output_formatted_line ( pd->format, cmd_list[0], 0, config.filter );
+ return TRUE;
+ }
if ( find_arg ( "-password" ) >= 0 ) {
menu_flags |= MENU_PASSWORD;
}