applied a change made by Uriel to dmenu (though I didn't applied everything)
This commit is contained in:
parent
1716159e05
commit
c9465859a6
19
main.c
19
main.c
|
@ -120,19 +120,8 @@ match(char *pattern) {
|
||||||
nitem = 0;
|
nitem = 0;
|
||||||
|
|
||||||
for(i = allitems; i; i=i->next)
|
for(i = allitems; i; i=i->next)
|
||||||
if(!plen || !strncmp(pattern, i->text, plen)) {
|
if(plen ? !strncmp(pattern, i->text, plen) :
|
||||||
if(!j)
|
strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) {
|
||||||
item = i;
|
|
||||||
else
|
|
||||||
j->right = i;
|
|
||||||
i->left = j;
|
|
||||||
i->right = NULL;
|
|
||||||
j = i;
|
|
||||||
nitem++;
|
|
||||||
}
|
|
||||||
for(i = allitems; i; i=i->next)
|
|
||||||
if(plen && strncmp(pattern, i->text, plen)
|
|
||||||
&& strstr(i->text, pattern)) {
|
|
||||||
if(!j)
|
if(!j)
|
||||||
item = i;
|
item = i;
|
||||||
else
|
else
|
||||||
|
@ -208,10 +197,8 @@ kpress(XKeyEvent * e) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XK_Return:
|
case XK_Return:
|
||||||
if(e->state & ShiftMask) {
|
if((e->state & ShiftMask) && text)
|
||||||
if(text)
|
|
||||||
fprintf(stdout, "%s", text);
|
fprintf(stdout, "%s", text);
|
||||||
}
|
|
||||||
else if(sel)
|
else if(sel)
|
||||||
fprintf(stdout, "%s", sel->text);
|
fprintf(stdout, "%s", sel->text);
|
||||||
else if(text)
|
else if(text)
|
||||||
|
|
Loading…
Reference in a new issue