From c0602f357d7b48ab830f93b446cb1830c5df7a0f Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 10 Apr 2020 07:44:26 +0000 Subject: Now that copy mode copies the pane content rather than keeping a reference to it, it isn't necessary that the pane in copy mode is the same as the one copying from. Add a -s flag to copy-mode to specify a different pane for the source content. This means it is possible to view two places in a pane's history at the same time in different panes, or copy from a pane's history into an editor or shell in the same pane. From Anindya Mukherjee. --- tmux.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index e66cbb39..5cc192fe 100644 --- a/tmux.h +++ b/tmux.h @@ -848,6 +848,7 @@ struct window_mode { /* Active window mode. */ struct window_mode_entry { struct window_pane *wp; + struct window_pane *swp; const struct window_mode *mode; void *data; @@ -2537,8 +2538,8 @@ void window_pane_unset_palette(struct window_pane *, u_int); void window_pane_reset_palette(struct window_pane *); int window_pane_get_palette(struct window_pane *, int); int window_pane_set_mode(struct window_pane *, - const struct window_mode *, struct cmd_find_state *, - struct args *); + struct window_pane *, const struct window_mode *, + struct cmd_find_state *, struct args *); void window_pane_reset_mode(struct window_pane *); void window_pane_reset_mode_all(struct window_pane *); int window_pane_key(struct window_pane *, struct client *, -- cgit From 1c433f135436664e3a369edbc43cb5cd057a8ae4 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 10 Apr 2020 20:53:54 +0000 Subject: Remove unused define, also a man fix from jmc. --- tmux.h | 1 - 1 file changed, 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 5cc192fe..8f8640bf 100644 --- a/tmux.h +++ b/tmux.h @@ -843,7 +843,6 @@ struct window_mode { void (*formats)(struct window_mode_entry *, struct format_tree *); }; -#define WINDOW_MODE_TIMEOUT 180 /* Active window mode. */ struct window_mode_entry { -- cgit From c20eb0c0ae3347c768894a6355adfd7ebae6f2f3 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 13 Apr 2020 08:26:27 +0000 Subject: Make struct cmd local to cmd.c and move it out of tmux.h. --- tmux.h | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 8f8640bf..539309da 100644 --- a/tmux.h +++ b/tmux.h @@ -39,9 +39,11 @@ extern char **environ; struct args; struct args_value; struct client; +struct cmd; struct cmd_find_state; struct cmdq_item; struct cmdq_list; +struct cmds; struct environ; struct format_job_tree; struct format_tree; @@ -50,8 +52,8 @@ struct job; struct mode_tree_data; struct mouse_event; struct options; -struct options_entry; struct options_array_item; +struct options_entry; struct session; struct tmuxpeer; struct tmuxproc; @@ -1335,27 +1337,11 @@ struct cmd_find_state { #define CMD_FIND_EXACT_WINDOW 0x20 #define CMD_FIND_CANFAIL 0x40 -/* Command and list of commands. */ -struct cmd { - const struct cmd_entry *entry; - struct args *args; - u_int group; - - char *file; - u_int line; - - char *alias; - int argc; - char **argv; - - TAILQ_ENTRY(cmd) qentry; -}; -TAILQ_HEAD(cmds, cmd); - +/* List of commands. */ struct cmd_list { - int references; - u_int group; - struct cmds list; + int references; + u_int group; + struct cmds *list; }; /* Command return values. */ @@ -2102,6 +2088,7 @@ int cmd_find_from_mouse(struct cmd_find_state *, int cmd_find_from_nothing(struct cmd_find_state *, int); /* cmd.c */ +extern const struct cmd_entry *cmd_table[]; void printflike(3, 4) cmd_log_argv(int, char **, const char *, ...); void cmd_prepend_argv(int *, char ***, char *); void cmd_append_argv(int *, char ***, char *); @@ -2111,16 +2098,27 @@ char **cmd_copy_argv(int, char **); void cmd_free_argv(int, char **); char *cmd_stringify_argv(int, char **); char *cmd_get_alias(const char *); +const struct cmd_entry *cmd_get_entry(struct cmd *); +struct args *cmd_get_args(struct cmd *); +void cmd_get_source(struct cmd *, const char **, u_int *); struct cmd *cmd_parse(int, char **, const char *, u_int, char **); 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_move(struct cmd_list *, struct cmd_list *); +void cmd_list_free(struct cmd_list *); +char *cmd_list_print(struct cmd_list *, int); +struct cmd *cmd_list_first(struct cmd_list *, u_int *); +struct cmd *cmd_list_next(struct cmd *, u_int *); +int cmd_list_all_have(struct cmd_list *, int); +int cmd_list_any_have(struct cmd_list *, int); int cmd_mouse_at(struct window_pane *, struct mouse_event *, u_int *, u_int *, int); struct winlink *cmd_mouse_window(struct mouse_event *, struct session **); struct window_pane *cmd_mouse_pane(struct mouse_event *, struct session **, struct winlink **); char *cmd_template_replace(const char *, const char *, int); -extern const struct cmd_entry *cmd_table[]; /* cmd-attach-session.c */ enum cmd_retval cmd_attach_session(struct cmdq_item *, const char *, int, int, @@ -2136,13 +2134,6 @@ struct cmd_parse_result *cmd_parse_from_buffer(const void *, size_t, struct cmd_parse_result *cmd_parse_from_arguments(int, char **, struct cmd_parse_input *); -/* cmd-list.c */ -struct cmd_list *cmd_list_new(void); -void cmd_list_append(struct cmd_list *, struct cmd *); -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); - /* cmd-queue.c */ struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmd_find_state *, struct mouse_event *, int); -- cgit