diff options
Diffstat (limited to 'scripts/kconfig/menu.c')
| -rw-r--r-- | scripts/kconfig/menu.c | 30 | 
1 files changed, 19 insertions, 11 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index b90fff833588..61c442d84aef 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -701,6 +701,11 @@ static void get_dep_str(struct gstr *r, struct expr *expr, const char *prefix)  	}  } +int __attribute__((weak)) get_jump_key_char(void) +{ +	return -1; +} +  static void get_prompt_str(struct gstr *r, struct property *prop,  			   struct list_head *head)  { @@ -730,24 +735,27 @@ static void get_prompt_str(struct gstr *r, struct property *prop,  	}  	if (head && location) {  		jump = xmalloc(sizeof(struct jump_key)); -  		jump->target = location; - -		if (list_empty(head)) -			jump->index = 0; -		else -			jump->index = list_entry(head->prev, struct jump_key, -						 entries)->index + 1; -  		list_add_tail(&jump->entries, head);  	}  	str_printf(r, "  Location:\n"); -	for (j = 4; --i >= 0; j += 2) { +	for (j = 0; --i >= 0; j++) { +		int jk = -1; +		int indent = 2 * j + 4; +  		menu = submenu[i]; -		if (jump && menu == location) +		if (jump && menu == location) {  			jump->offset = strlen(r->s); -		str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu)); +			jk = get_jump_key_char(); +		} + +		if (jk >= 0) { +			str_printf(r, "(%c)", jk); +			indent -= 3; +		} + +		str_printf(r, "%*c-> %s", indent, ' ', menu_get_prompt(menu));  		if (menu->sym) {  			str_printf(r, " (%s [=%s])", menu->sym->name ?  				menu->sym->name : "<choice>",  |