mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Move the NOHOOKS flag into the shared flags.
This commit is contained in:
		
							
								
								
									
										14
									
								
								cmd-queue.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								cmd-queue.c
									
									
									
									
									
								
							@@ -25,6 +25,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Command queue flags. */
 | 
				
			||||||
 | 
					#define CMDQ_FIRED 0x1
 | 
				
			||||||
 | 
					#define CMDQ_WAITING 0x2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Command queue item type. */
 | 
					/* Command queue item type. */
 | 
				
			||||||
enum cmdq_type {
 | 
					enum cmdq_type {
 | 
				
			||||||
	CMDQ_COMMAND,
 | 
						CMDQ_COMMAND,
 | 
				
			||||||
@@ -224,7 +228,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item,
 | 
				
			|||||||
	struct options_array_item	*a;
 | 
						struct options_array_item	*a;
 | 
				
			||||||
	struct cmd_list			*cmdlist;
 | 
						struct cmd_list			*cmdlist;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (item->flags & CMDQ_NOHOOKS)
 | 
						if (item->shared->flags & CMDQ_SHARED_NOHOOKS)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	if (s == NULL)
 | 
						if (s == NULL)
 | 
				
			||||||
		oo = global_s_options;
 | 
							oo = global_s_options;
 | 
				
			||||||
@@ -250,7 +254,8 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item,
 | 
				
			|||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		new_item = cmdq_get_command(cmdlist, fs, NULL, CMDQ_NOHOOKS);
 | 
							new_item = cmdq_get_command(cmdlist, fs, NULL,
 | 
				
			||||||
 | 
							    CMDQ_SHARED_NOHOOKS);
 | 
				
			||||||
		cmdq_format(new_item, "hook", "%s", name);
 | 
							cmdq_format(new_item, "hook", "%s", name);
 | 
				
			||||||
		if (item != NULL)
 | 
							if (item != NULL)
 | 
				
			||||||
			item = cmdq_insert_after(item, new_item);
 | 
								item = cmdq_insert_after(item, new_item);
 | 
				
			||||||
@@ -330,6 +335,7 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
 | 
				
			|||||||
				cmd_find_clear_state(&shared->current, 0);
 | 
									cmd_find_clear_state(&shared->current, 0);
 | 
				
			||||||
			if (m != NULL)
 | 
								if (m != NULL)
 | 
				
			||||||
				memcpy(&shared->mouse, m, sizeof shared->mouse);
 | 
									memcpy(&shared->mouse, m, sizeof shared->mouse);
 | 
				
			||||||
 | 
								shared->flags = flags;
 | 
				
			||||||
			last_group = group;
 | 
								last_group = group;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		entry = cmd_get_entry(cmd);
 | 
							entry = cmd_get_entry(cmd);
 | 
				
			||||||
@@ -337,9 +343,7 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
 | 
				
			|||||||
		item = xcalloc(1, sizeof *item);
 | 
							item = xcalloc(1, sizeof *item);
 | 
				
			||||||
		xasprintf(&item->name, "[%s/%p]", entry->name, item);
 | 
							xasprintf(&item->name, "[%s/%p]", entry->name, item);
 | 
				
			||||||
		item->type = CMDQ_COMMAND;
 | 
							item->type = CMDQ_COMMAND;
 | 
				
			||||||
 | 
					 | 
				
			||||||
		item->group = group;
 | 
							item->group = group;
 | 
				
			||||||
		item->flags = flags;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		item->shared = shared;
 | 
							item->shared = shared;
 | 
				
			||||||
		item->cmdlist = cmdlist;
 | 
							item->cmdlist = cmdlist;
 | 
				
			||||||
@@ -447,9 +451,7 @@ cmdq_get_callback1(const char *name, cmdq_cb cb, void *data)
 | 
				
			|||||||
	item = xcalloc(1, sizeof *item);
 | 
						item = xcalloc(1, sizeof *item);
 | 
				
			||||||
	xasprintf(&item->name, "[%s/%p]", name, item);
 | 
						xasprintf(&item->name, "[%s/%p]", name, item);
 | 
				
			||||||
	item->type = CMDQ_CALLBACK;
 | 
						item->type = CMDQ_CALLBACK;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	item->group = 0;
 | 
						item->group = 0;
 | 
				
			||||||
	item->flags = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	item->cb = cb;
 | 
						item->cb = cb;
 | 
				
			||||||
	item->data = data;
 | 
						item->data = data;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								notify.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								notify.c
									
									
									
									
									
								
							@@ -95,7 +95,8 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
 | 
				
			|||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		new_item = cmdq_get_command(cmdlist, &fs, NULL, CMDQ_NOHOOKS);
 | 
							new_item = cmdq_get_command(cmdlist, &fs, NULL,
 | 
				
			||||||
 | 
							    CMDQ_SHARED_NOHOOKS);
 | 
				
			||||||
		cmdq_format(new_item, "hook", "%s", ne->name);
 | 
							cmdq_format(new_item, "hook", "%s", ne->name);
 | 
				
			||||||
		notify_hook_formats(new_item, s, w, ne->pane);
 | 
							notify_hook_formats(new_item, s, w, ne->pane);
 | 
				
			||||||
		item = cmdq_insert_after(item, new_item);
 | 
							item = cmdq_insert_after(item, new_item);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1385,6 +1385,7 @@ struct cmdq_shared {
 | 
				
			|||||||
	int			 flags;
 | 
						int			 flags;
 | 
				
			||||||
#define CMDQ_SHARED_REPEAT 0x1
 | 
					#define CMDQ_SHARED_REPEAT 0x1
 | 
				
			||||||
#define CMDQ_SHARED_CONTROL 0x2
 | 
					#define CMDQ_SHARED_CONTROL 0x2
 | 
				
			||||||
 | 
					#define CMDQ_SHARED_NOHOOKS 0x4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct format_tree	*formats;
 | 
						struct format_tree	*formats;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1392,11 +1393,6 @@ struct cmdq_shared {
 | 
				
			|||||||
	struct cmd_find_state	 current;
 | 
						struct cmd_find_state	 current;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Command queue flags. */
 | 
					 | 
				
			||||||
#define CMDQ_FIRED 0x1
 | 
					 | 
				
			||||||
#define CMDQ_WAITING 0x2
 | 
					 | 
				
			||||||
#define CMDQ_NOHOOKS 0x4
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Command queue callback. */
 | 
					/* Command queue callback. */
 | 
				
			||||||
typedef enum cmd_retval (*cmdq_cb) (struct cmdq_item *, void *);
 | 
					typedef enum cmd_retval (*cmdq_cb) (struct cmdq_item *, void *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user