aboutsummaryrefslogtreecommitdiffstats
path: root/search.c
diff options
context:
space:
mode:
authorokan2015-06-30 18:54:12 +0000
committerokan2015-06-30 18:54:12 +0000
commit71d55b5fbd537c425ecee3649e183818b220d5ef (patch)
treeb689288dc8cabf59d400be88e10bd2bcd7605fa1 /search.c
parent931b7e89b025a354af81008fc7f799903ea16bee (diff)
downloadcwm-71d55b5fbd537c425ecee3649e183818b220d5ef.tar.gz
Introduce a callback for cmd menu printing, special-casing 'lock' and
'term'.
Diffstat (limited to '')
-rw-r--r--search.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/search.c b/search.c
index a4046cb..d04221d 100644
--- a/search.c
+++ b/search.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: search.c,v 1.45 2015/06/30 18:42:50 okan Exp $
+ * $OpenBSD: search.c,v 1.46 2015/06/30 18:54:12 okan Exp $
*/
#include <sys/types.h>
@@ -124,6 +124,20 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
}
void
+search_print_cmd(struct menu *mi, int i)
+{
+ struct cmd *cmd = (struct cmd *)mi->ctx;
+ int special = 0;
+
+ if ((strcmp(cmd->name, "lock") == 0) ||
+ (strcmp(cmd->name, "term") == 0))
+ special = 1;
+
+ (void)snprintf(mi->print, sizeof(mi->print),
+ (special) ? "[%s]" : "%s", cmd->name);
+}
+
+void
search_print_client(struct menu *mi, int list)
{
struct client_ctx *cc = (struct client_ctx *)mi->ctx;