diff options
author | okan | 2016-10-24 17:16:23 +0000 |
---|---|---|
committer | okan | 2016-10-24 17:16:23 +0000 |
commit | 2e42cacbc2852535c15f8a6b7aaa7078d073ca26 (patch) | |
tree | f59f72172ee6e1d1271addd3c920f0c3ce5f5088 /search.c | |
parent | bde8d76ba0ceed7d7f2a34525483b08d83208003 (diff) | |
download | cwm-2e42cacbc2852535c15f8a6b7aaa7078d073ca26.tar.gz |
Get rid of 'matchname'; it's too surprising to have the menu change during
client search as different potential str matches are cycled through. If there's
interest, the only string that doesn't exist in the listing is the window's
class - that can be added of course, but it makes the line too long imho.
Diffstat (limited to 'search.c')
-rw-r--r-- | search.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -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.54 2016/10/22 19:16:43 okan Exp $ + * $OpenBSD: search.c,v 1.55 2016/10/24 17:16:23 okan Exp $ */ #include <sys/types.h> @@ -57,26 +57,21 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) struct client_ctx *cc = (struct client_ctx *)mi->ctx; /* Match on label. */ - if ((cc->label) && strsubmatch(search, cc->label, 0)) { - cc->matchname = cc->label; + if ((cc->label) && strsubmatch(search, cc->label, 0)) tier = 0; - } /* Match on window name history, from present to past. */ if (tier < 0) { TAILQ_FOREACH_REVERSE(wn, &cc->nameq, name_q, entry) if (strsubmatch(search, wn->name, 0)) { - cc->matchname = wn->name; tier = 2; break; } } /* Match on window class name. */ - if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0)) { - cc->matchname = cc->ch.res_class; + if ((tier < 0) && strsubmatch(search, cc->ch.res_class, 0)) tier = 3; - } if (tier < 0) continue; @@ -140,12 +135,9 @@ search_print_client(struct menu *mi, int list) else if (cc->flags & CLIENT_HIDDEN) flag = '&'; - if ((list) || (cc->matchname == cc->label)) - cc->matchname = cc->name; - (void)snprintf(mi->print, sizeof(mi->print), "(%d) %c[%s] %s", (cc->gc) ? cc->gc->num : 0, flag, - (cc->label) ? cc->label : "", cc->matchname); + (cc->label) ? cc->label : "", cc->name); } static void |