1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Undo commit of sorting changes, did not want to apply this yet.

This commit is contained in:
Dave Davenport 2015-07-10 21:33:26 +02:00
parent d549659f1e
commit d27b8a21e9

View file

@ -727,17 +727,7 @@ static void menu_refilter ( MenuState *state, char **lines, menu_match_cb mmc, v
if ( match ) { if ( match ) {
state->line_map[j] = i; state->line_map[j] = i;
if ( sorting ) { if ( sorting ) {
state->distance[i] = 0; state->distance[i] = levenshtein ( state->text->text, lines[i] );
char **words = tokenize ( lines[i], case_sensitive );
for( int k = 0; tokens && tokens[k]; k++) {
for ( int j = 0; words && words[j]; j++) {
if (strcasecmp ( tokens[k], words[j] ) != 0)
state->distance[i] += levenshtein ( tokens[k], words[j] ) * strlen(tokens[k]);
else
state->distance[i] -= strlen (tokens[k]) << 1;
}
}
g_strfreev ( words );
} }
j++; j++;
} }