1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -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 ) {
state->line_map[j] = i;
if ( sorting ) {
state->distance[i] = 0;
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 );
state->distance[i] = levenshtein ( state->text->text, lines[i] );
}
j++;
}