mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Drop having a separate type for style options and make them all strings,
which allows formats to be expanded. Any styles without a '#{' are still validated when they are set but any with a '#{' are not. Formats are not expanded usefully in many cases yet, that will be changed later. To make this work, a few other changes: - set-option -a with a style option automatically appends a ",". - OSC 10 and 11 don't set the window-style option anymore, instead the fg and bg are stored in the pane struct and act as the defaults that can be overridden by window-style. - status-fg and -bg now override status-style instead of trying to keep them in sync.
This commit is contained in:
31
tmux.h
31
tmux.h
@ -896,6 +896,9 @@ struct window_pane {
|
||||
u_int xoff;
|
||||
u_int yoff;
|
||||
|
||||
int fg;
|
||||
int bg;
|
||||
|
||||
int flags;
|
||||
#define PANE_REDRAW 0x1
|
||||
#define PANE_DROP 0x2
|
||||
@ -950,6 +953,9 @@ struct window_pane {
|
||||
size_t written;
|
||||
size_t skipped;
|
||||
|
||||
int border_gc_set;
|
||||
struct grid_cell border_gc;
|
||||
|
||||
TAILQ_ENTRY(window_pane) entry;
|
||||
RB_ENTRY(window_pane) tree_entry;
|
||||
};
|
||||
@ -1662,7 +1668,6 @@ enum options_table_type {
|
||||
OPTIONS_TABLE_COLOUR,
|
||||
OPTIONS_TABLE_FLAG,
|
||||
OPTIONS_TABLE_CHOICE,
|
||||
OPTIONS_TABLE_STYLE,
|
||||
OPTIONS_TABLE_COMMAND
|
||||
};
|
||||
|
||||
@ -1674,12 +1679,13 @@ enum options_table_type {
|
||||
|
||||
#define OPTIONS_TABLE_IS_ARRAY 0x1
|
||||
#define OPTIONS_TABLE_IS_HOOK 0x2
|
||||
#define OPTIONS_TABLE_IS_STYLE 0x4
|
||||
|
||||
struct options_table_entry {
|
||||
const char *name;
|
||||
enum options_table_type type;
|
||||
int scope;
|
||||
int flags;
|
||||
int flags;
|
||||
|
||||
u_int minimum;
|
||||
u_int maximum;
|
||||
@ -1718,7 +1724,7 @@ struct spawn_context {
|
||||
const char *name;
|
||||
char **argv;
|
||||
int argc;
|
||||
struct environ *environ;
|
||||
struct environ *environ;
|
||||
|
||||
int idx;
|
||||
const char *cwd;
|
||||
@ -1898,18 +1904,17 @@ struct options_entry *options_match_get(struct options *, const char *, int *,
|
||||
int, int *);
|
||||
const char *options_get_string(struct options *, const char *);
|
||||
long long options_get_number(struct options *, const char *);
|
||||
struct style *options_get_style(struct options *, const char *);
|
||||
struct options_entry * printflike(4, 5) options_set_string(struct options *,
|
||||
const char *, int, const char *, ...);
|
||||
struct options_entry *options_set_number(struct options *, const char *,
|
||||
long long);
|
||||
struct options_entry *options_set_style(struct options *, const char *, int,
|
||||
const char *);
|
||||
int options_scope_from_name(struct args *, int,
|
||||
const char *, struct cmd_find_state *, struct options **,
|
||||
char **);
|
||||
int options_scope_from_flags(struct args *, int,
|
||||
struct cmd_find_state *, struct options **, char **);
|
||||
struct style *options_string_to_style(struct options *, const char *,
|
||||
struct format_tree *);
|
||||
|
||||
/* options-table.c */
|
||||
extern const struct options_table_entry options_table[];
|
||||
@ -2136,7 +2141,7 @@ enum cmd_retval cmd_attach_session(struct cmdq_item *, const char *, int, int,
|
||||
int, const char *, int);
|
||||
|
||||
/* cmd-parse.c */
|
||||
void cmd_parse_empty(struct cmd_parse_input *);
|
||||
void cmd_parse_empty(struct cmd_parse_input *);
|
||||
struct cmd_parse_result *cmd_parse_from_file(FILE *, struct cmd_parse_input *);
|
||||
struct cmd_parse_result *cmd_parse_from_string(const char *,
|
||||
struct cmd_parse_input *);
|
||||
@ -2227,8 +2232,8 @@ void file_fire_done(struct client_file *);
|
||||
void file_fire_read(struct client_file *);
|
||||
int file_can_print(struct client *);
|
||||
void printflike(2, 3) file_print(struct client *, const char *, ...);
|
||||
void file_vprint(struct client *, const char *, va_list);
|
||||
void file_print_buffer(struct client *, void *, size_t);
|
||||
void file_vprint(struct client *, const char *, va_list);
|
||||
void file_print_buffer(struct client *, void *, size_t);
|
||||
void printflike(2, 3) file_error(struct client *, const char *, ...);
|
||||
void file_write(struct client *, const char *, int, const void *, size_t,
|
||||
client_file_cb, void *);
|
||||
@ -2726,7 +2731,7 @@ struct session *session_find_by_id_str(const char *);
|
||||
struct session *session_find_by_id(u_int);
|
||||
struct session *session_create(const char *, const char *, const char *,
|
||||
struct environ *, struct options *, struct termios *);
|
||||
void session_destroy(struct session *, int, const char *);
|
||||
void session_destroy(struct session *, int, const char *);
|
||||
void session_add_ref(struct session *, const char *);
|
||||
void session_remove_ref(struct session *, const char *);
|
||||
char *session_check_name(const char *);
|
||||
@ -2795,7 +2800,7 @@ struct menu *menu_create(const char *);
|
||||
void menu_add_items(struct menu *, const struct menu_item *,
|
||||
struct cmdq_item *, struct client *,
|
||||
struct cmd_find_state *);
|
||||
void menu_add_item(struct menu *, const struct menu_item *,
|
||||
void menu_add_item(struct menu *, const struct menu_item *,
|
||||
struct cmdq_item *, struct client *,
|
||||
struct cmd_find_state *);
|
||||
void menu_free(struct menu *);
|
||||
@ -2818,8 +2823,10 @@ int popup_display(int, struct cmdq_item *, u_int, u_int, u_int,
|
||||
int style_parse(struct style *,const struct grid_cell *,
|
||||
const char *);
|
||||
const char *style_tostring(struct style *);
|
||||
void style_add(struct grid_cell *, struct options *,
|
||||
const char *, struct format_tree *);
|
||||
void style_apply(struct grid_cell *, struct options *,
|
||||
const char *);
|
||||
const char *, struct format_tree *);
|
||||
void style_set(struct style *, const struct grid_cell *);
|
||||
void style_copy(struct style *, struct style *);
|
||||
|
||||
|
Reference in New Issue
Block a user