mirror of
https://github.com/davatorium/rofi.git
synced 2025-02-03 15:34:54 -05:00
Test to see if this fixes issue from Rafi.
This commit is contained in:
parent
5a8a249fa6
commit
d02f43966e
2 changed files with 9 additions and 0 deletions
|
@ -73,6 +73,9 @@ SwitcherMode dmenu_switcher_dialog ( char **input, void *data )
|
|||
char **list = get_dmenu ( &length );
|
||||
int restart = FALSE;
|
||||
|
||||
// Force off sorting. (TODO: should be an argument to menu, and not hacking the user config.)
|
||||
config.levenshtein_sort = FALSE;
|
||||
|
||||
do {
|
||||
int shift = 0;
|
||||
int mretv = menu ( list, length, input, dmenu_prompt, NULL, &shift,
|
||||
|
|
|
@ -1211,6 +1211,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
|||
KeySym prev_key = 0;
|
||||
unsigned int selected = 0;
|
||||
int last_offset = 0;
|
||||
int init = 0;
|
||||
if ( selected_line != NULL ) {
|
||||
if ( *selected_line >= 0 && *selected_line <= num_lines ) {
|
||||
selected = *selected_line;
|
||||
|
@ -1233,6 +1234,11 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
|||
if ( config.levenshtein_sort ) {
|
||||
distance[i] = levenshtein ( text->text, lines[i] );
|
||||
}
|
||||
// Try to look-up the selected line and highlight that.
|
||||
if(init == 0 && selected_line != NULL && (*selected_line) == i) {
|
||||
selected = j;
|
||||
init = 1;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue