1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-01-27 15:25:24 -05:00

[Combi] only textual map, when not using glob/regex mode.

This commit is contained in:
Dave Davenport 2015-11-24 14:14:55 +01:00
parent fa2bcd778c
commit 6978b146f0

View file

@ -174,7 +174,16 @@ static int combi_mode_match ( const Switcher *sw, char **tokens, int not_ascii,
int case_sensitive, unsigned int index )
{
CombiModePrivateData *pd = sw->private_data;
if ( config.regex || config.glob ) {
// Bang support only works in text mode.
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
return pd->switchers[i]->token_match ( pd->switchers[i], tokens, not_ascii, case_sensitive,
index - pd->starts[i] );
}
}
}
else{
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
if ( tokens && tokens[0][0] == '!' ) {
@ -190,6 +199,7 @@ static int combi_mode_match ( const Switcher *sw, char **tokens, int not_ascii,
}
}
}
}
abort ();
return 0;
}
@ -239,9 +249,7 @@ static char * combi_get_completion ( const Switcher *sw, unsigned int index )
int state;
str = pd->switchers[i]->mgrv ( index - pd->starts[i], (void *) pd->switchers[i], &state, TRUE );
}
char *retv = g_strdup_printf ( "!%c %s", pd->switchers[i]->name[0], str );
g_free ( str );
return retv;
return str;
}
}
// Should never get here.