commit - 8b92991808127e109d39ff91f72dc67a5a3d93f5
commit + 14291de3b2d18ecf647f9a7363d2286a3782d721
blob - 8cb4b79f1fb61189a557dd51b549b8b58fbe5f9f
blob + 71c4aad0fc4e5a2bbf7616616d97d498337d80a9
--- mymenu.c
+++ mymenu.c
case CONFIRM:
status = OK;
- if (first_selected) {
- complete(cs, first_selected, false, &text, &textlen, &status);
+
+ // if first_selected is active and the first completion is
+ // active be sure to 'expand' the text to match the selection
+ if (first_selected && cs->selected) {
+ free(text);
+ text = strdup(cs->completion);
+ if (text == nil) {
+ fprintf(stderr, "Memory allocation error");
+ status = ERR;
+ }
+ textlen = strlen(text);
}
break;
free(input);
}
}
+
+ break;
}
+
}
- draw(&r, text, cs);
- break;
default:
fprintf(stderr, "Unknown event %d\n", e.type);
}
+
+ draw(&r, text, cs);
}
if (status == OK)