mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Preserve command group when moving temporary list to current list being
buit.
This commit is contained in:
		@@ -871,7 +871,7 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
 | 
			
		||||
			cmd_list_free(current);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		cmd_list_move(current, add);
 | 
			
		||||
		cmd_list_append_all(current, add);
 | 
			
		||||
		cmd_list_free(add);
 | 
			
		||||
	}
 | 
			
		||||
	if (current != NULL) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								cmd.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								cmd.c
									
									
									
									
									
								
							@@ -594,7 +594,18 @@ cmd_list_append(struct cmd_list *cmdlist, struct cmd *cmd)
 | 
			
		||||
	TAILQ_INSERT_TAIL(cmdlist->list, cmd, qentry);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Move all commands from one command list to another */
 | 
			
		||||
/* Append all commands from one list to another.  */
 | 
			
		||||
void
 | 
			
		||||
cmd_list_append_all(struct cmd_list *cmdlist, struct cmd_list *from)
 | 
			
		||||
{
 | 
			
		||||
	struct cmd	*cmd;
 | 
			
		||||
 | 
			
		||||
	TAILQ_FOREACH(cmd, from->list, qentry)
 | 
			
		||||
		cmd->group = cmdlist->group;
 | 
			
		||||
	TAILQ_CONCAT(cmdlist->list, from->list, qentry);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Move all commands from one command list to another. */
 | 
			
		||||
void
 | 
			
		||||
cmd_list_move(struct cmd_list *cmdlist, struct cmd_list *from)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -2256,6 +2256,7 @@ void		 cmd_free(struct cmd *);
 | 
			
		||||
char		*cmd_print(struct cmd *);
 | 
			
		||||
struct cmd_list	*cmd_list_new(void);
 | 
			
		||||
void		 cmd_list_append(struct cmd_list *, struct cmd *);
 | 
			
		||||
void		 cmd_list_append_all(struct cmd_list *, struct cmd_list *);
 | 
			
		||||
void		 cmd_list_move(struct cmd_list *, struct cmd_list *);
 | 
			
		||||
void		 cmd_list_free(struct cmd_list *);
 | 
			
		||||
char		*cmd_list_print(struct cmd_list *, int);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user