mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Final parts of command hooks, add before- and after- hooks to each command.
This commit is contained in:
		
							
								
								
									
										5
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								format.c
									
									
									
									
									
								
							@@ -468,6 +468,7 @@ struct format_tree *
 | 
			
		||||
format_create(struct cmd_q *cmdq, int flags)
 | 
			
		||||
{
 | 
			
		||||
	struct format_tree	*ft;
 | 
			
		||||
	struct cmd		*cmd;
 | 
			
		||||
 | 
			
		||||
	if (!event_initialized(&format_job_event)) {
 | 
			
		||||
		evtimer_set(&format_job_event, format_job_timer, NULL);
 | 
			
		||||
@@ -486,6 +487,10 @@ format_create(struct cmd_q *cmdq, int flags)
 | 
			
		||||
 | 
			
		||||
	if (cmdq != NULL && cmdq->cmd != NULL)
 | 
			
		||||
		format_add(ft, "command_name", "%s", cmdq->cmd->entry->name);
 | 
			
		||||
	if (cmdq != NULL && cmdq->parent != NULL) {
 | 
			
		||||
		cmd = cmdq->parent->cmd;
 | 
			
		||||
		format_add(ft, "command_hooked", "%s", cmd->entry->name);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (ft);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user