mirror of
https://github.com/davatorium/rofi.git
synced 2025-04-07 17:33:14 -04:00
Use right modifier
This commit is contained in:
parent
c4df969432
commit
d549659f1e
2 changed files with 12 additions and 2 deletions
|
@ -57,7 +57,7 @@ void i3_support_focus_window ( Window id )
|
|||
char command[upm];
|
||||
|
||||
if ( strlen ( i3_socket_path ) > upm ) {
|
||||
fprintf ( stderr, "Socket path is too long. %zd > %lu\n", strlen ( i3_socket_path ), upm );
|
||||
fprintf ( stderr, "Socket path is too long. %zd > %zd\n", strlen ( i3_socket_path ), upm );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -727,7 +727,17 @@ 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] = levenshtein ( state->text->text, lines[i] );
|
||||
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 );
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue