Make tab-complete.c easier to maintain

Make tab-complete.c easier to maintain

Edit