]> git.mdlowis.com Git - projs/tide.git/commitdiff
update xpick to print out the only option when only one line received
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 30 Nov 2016 21:14:05 +0000 (16:14 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 30 Nov 2016 21:14:05 +0000 (16:14 -0500)
xpick.c

diff --git a/xpick.c b/xpick.c
index 4a8d070325a4284ca80f66e87169a00386e82fca..30980ab7ae1c51d78b059ecbde34afb27ece2878 100644 (file)
--- a/xpick.c
+++ b/xpick.c
@@ -195,14 +195,16 @@ static void keyboard_input(int mods, uint32_t key) {
 
 int main(int argc, char** argv) {
     load_choices();
-    /* initialize the filter edit buffer */
-    buf_init(&Query);
-    /* initialize the display engine */
-    x11_init(&Config);
-    x11_dialog("pick", Width, Height);
-    x11_show();
-    Font = x11_font_load(FONTNAME);
-    x11_loop();
+    if (vec_size(&Choices) > 1) {
+        /* initialize the filter edit buffer */
+        buf_init(&Query);
+        /* initialize the display engine */
+        x11_init(&Config);
+        x11_dialog("pick", Width, Height);
+        x11_show();
+        Font = x11_font_load(FONTNAME);
+        x11_loop();
+    }
     /* print out the choice */
     if (vec_size(&Choices) && ChoiceIdx != SIZE_MAX) {
         Choice* choice = (Choice*)vec_at(&Choices, ChoiceIdx);