Hello, I'm a Grub user (thanks for your nice work!) and I always wanted to have a menu that "loops". Like, if you press down and you are in the last option it goes to the first one, and if you press up but you are int he first option goes to the last.
Attached comes a patch against revision 1718. Of course, feel free to comment anything about it. I'm open to change, fix, etc. I also don't know if this functionality is not in Grub because you thought that was better to not have this functionality. I've copied/change a few lines (after the patch, lines 425-428 are the same than lines 347-350). I don't think that it's needed to refactor but if you think so I can do it. Thank you, -- Carles Pina i Estany GPG id: 0x8CBDAE64 http://pinux.info Manresa - Barcelona
Index: normal/menu.c =================================================================== --- normal/menu.c (revision 1717) +++ normal/menu.c (working copy) @@ -420,6 +420,17 @@ first--; print_entries (menu, first, offset); } + else if (first==0) + { + // Highlight the last entry + offset = menu->size - 1; + if (offset > GRUB_TERM_NUM_ENTRIES - 1) + { + first = offset - (GRUB_TERM_NUM_ENTRIES - 1); + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + print_entries (menu, first, offset); + } break; case 14: @@ -440,6 +451,13 @@ print_entries (menu, first, offset); } } + else + { + // Highlight the first entry + first=0; + offset=0; + print_entries (menu, first, offset); + } break; case '\n':
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel