|
21 | 21 |
|
22 | 22 | #include "lkc.h" |
23 | 23 | #include "lxdialog/dialog.h" |
| 24 | +#include "mnconf-common.h" |
24 | 25 |
|
25 | 26 | static const char mconf_readme[] = |
26 | 27 | "Overview\n" |
@@ -286,7 +287,6 @@ static int single_menu_mode; |
286 | 287 | static int show_all_options; |
287 | 288 | static int save_and_exit; |
288 | 289 | static int silent; |
289 | | -static int jump_key_char; |
290 | 290 |
|
291 | 291 | static void conf(struct menu *menu, struct menu *active_menu); |
292 | 292 |
|
@@ -378,58 +378,6 @@ static void show_help(struct menu *menu) |
378 | 378 | str_free(&help); |
379 | 379 | } |
380 | 380 |
|
381 | | -struct search_data { |
382 | | - struct list_head *head; |
383 | | - struct menu *target; |
384 | | -}; |
385 | | - |
386 | | -static int next_jump_key(int key) |
387 | | -{ |
388 | | - if (key < '1' || key > '9') |
389 | | - return '1'; |
390 | | - |
391 | | - key++; |
392 | | - |
393 | | - if (key > '9') |
394 | | - key = '1'; |
395 | | - |
396 | | - return key; |
397 | | -} |
398 | | - |
399 | | -static int handle_search_keys(int key, size_t start, size_t end, void *_data) |
400 | | -{ |
401 | | - struct search_data *data = _data; |
402 | | - struct jump_key *pos; |
403 | | - int index = 0; |
404 | | - |
405 | | - if (key < '1' || key > '9') |
406 | | - return 0; |
407 | | - |
408 | | - list_for_each_entry(pos, data->head, entries) { |
409 | | - index = next_jump_key(index); |
410 | | - |
411 | | - if (pos->offset < start) |
412 | | - continue; |
413 | | - |
414 | | - if (pos->offset >= end) |
415 | | - break; |
416 | | - |
417 | | - if (key == index) { |
418 | | - data->target = pos->target; |
419 | | - return 1; |
420 | | - } |
421 | | - } |
422 | | - |
423 | | - return 0; |
424 | | -} |
425 | | - |
426 | | -int get_jump_key_char(void) |
427 | | -{ |
428 | | - jump_key_char = next_jump_key(jump_key_char); |
429 | | - |
430 | | - return jump_key_char; |
431 | | -} |
432 | | - |
433 | 381 | static void search_conf(void) |
434 | 382 | { |
435 | 383 | struct symbol **sym_arr; |
|
0 commit comments