Compare commits
	
		
			2 Commits
		
	
	
		
			a20e4c74d8
			...
			da14bdbd39
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| da14bdbd39 | |||
| 24e57872d8 | 
							
								
								
									
										31
									
								
								nncmpp.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								nncmpp.c
									
									
									
									
									
								
							| @ -2508,6 +2508,17 @@ app_mpd_toggle (const char *name) | |||||||
| 	return MPD_SIMPLE (name, value ? "0" : "1"); | 	return MPD_SIMPLE (name, value ? "0" : "1"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static void | ||||||
|  | app_hide_message (void) | ||||||
|  | { | ||||||
|  | 	if (g.message) | ||||||
|  | 	{ | ||||||
|  | 		cstr_set (&g.message, NULL); | ||||||
|  | 		poller_timer_reset (&g.message_timer); | ||||||
|  | 		app_invalidate (); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| static bool | static bool | ||||||
| app_process_action (enum action action) | app_process_action (enum action action) | ||||||
| { | { | ||||||
| @ -2542,6 +2553,7 @@ app_process_action (enum action action) | |||||||
| 		line_editor_start (&g.editor, ':'); | 		line_editor_start (&g.editor, ':'); | ||||||
| 		g.editor.on_end = app_on_mpd_command_editor_end; | 		g.editor.on_end = app_on_mpd_command_editor_end; | ||||||
| 		app_invalidate (); | 		app_invalidate (); | ||||||
|  | 		app_hide_message (); | ||||||
| 		return true; | 		return true; | ||||||
| 	default: | 	default: | ||||||
| 		print_error ("can't do that here: %s", g_action_descriptions[action]); | 		print_error ("can't do that here: %s", g_action_descriptions[action]); | ||||||
| @ -2563,6 +2575,7 @@ app_process_action (enum action action) | |||||||
| 		g.editor.on_changed = incremental_search_on_changed; | 		g.editor.on_changed = incremental_search_on_changed; | ||||||
| 		g.editor.on_end = incremental_search_on_end; | 		g.editor.on_end = incremental_search_on_end; | ||||||
| 		app_invalidate (); | 		app_invalidate (); | ||||||
|  | 		app_hide_message (); | ||||||
| 		return true; | 		return true; | ||||||
| 
 | 
 | ||||||
| 	case ACTION_TAB_LAST: | 	case ACTION_TAB_LAST: | ||||||
| @ -2764,9 +2777,7 @@ app_process_left_mouse_click (struct widget *w, int x, int y, bool double_click) | |||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
| 	case WIDGET_MESSAGE: | 	case WIDGET_MESSAGE: | ||||||
| 		cstr_set (&g.message, NULL); | 		app_hide_message (); | ||||||
| 		poller_timer_reset (&g.message_timer); |  | ||||||
| 		app_invalidate (); |  | ||||||
| 	} | 	} | ||||||
| 	return true; | 	return true; | ||||||
| } | } | ||||||
| @ -3029,6 +3040,11 @@ app_process_termo_event (termo_key_t *event) | |||||||
| 	struct binding dummy = { *event, 0, 0 }, *binding; | 	struct binding dummy = { *event, 0, 0 }, *binding; | ||||||
| 	if (g.editor.line) | 	if (g.editor.line) | ||||||
| 	{ | 	{ | ||||||
|  | 		if (event->type == TERMO_TYPE_KEY | ||||||
|  | 		 || event->type == TERMO_TYPE_FUNCTION | ||||||
|  | 		 || event->type == TERMO_TYPE_KEYSYM) | ||||||
|  | 			app_hide_message (); | ||||||
|  | 
 | ||||||
| 		if ((binding = bsearch (&dummy, g_editor_keys, g_editor_keys_len, | 		if ((binding = bsearch (&dummy, g_editor_keys, g_editor_keys_len, | ||||||
| 			sizeof *binding, app_binding_cmp))) | 			sizeof *binding, app_binding_cmp))) | ||||||
| 			return app_editor_process_action (binding->action); | 			return app_editor_process_action (binding->action); | ||||||
| @ -4032,9 +4048,12 @@ help_tab_on_action (enum action action) | |||||||
| 		return false; | 		return false; | ||||||
| 
 | 
 | ||||||
| 	action = g_help_tab.actions[tab->item_selected]; | 	action = g_help_tab.actions[tab->item_selected]; | ||||||
| 	return action != ACTION_NONE | 	if (action == ACTION_NONE || action == ACTION_CHOOSE /* avoid recursion */) | ||||||
| 		&& action != ACTION_CHOOSE  // avoid recursion
 | 		return false; | ||||||
| 		&& app_process_action (action); | 
 | ||||||
|  | 	// XXX: We can't propagate failure, which produces beeps in the TUI, but we
 | ||||||
|  | 	// don't want to let our caller show a bad "can't do that" message either.
 | ||||||
|  | 	return app_process_action (action), true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user