From 99515f986e941a40948f3fca37713e0758c9a1c5 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 17 Feb 2016 08:44:51 +0100 Subject: [PATCH] Fix issue #281 if one entry as input and autoselect enabled return immediately --- Changelog | 2 ++ source/dialogs/dmenu.c | 4 ++++ 2 files changed, 6 insertions(+) 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; }