mirror of
https://github.com/tmux/tmux.git
synced 2026-01-11 16:30:22 +00:00
Merge branch 'obsd-master'
This commit is contained in:
@@ -109,7 +109,8 @@ cmd_list_keys_print_notes(struct cmdq_item *item, struct args *args,
|
|||||||
key = key_string_lookup_key(bd->key, 0);
|
key = key_string_lookup_key(bd->key, 0);
|
||||||
|
|
||||||
if (bd->note == NULL || *bd->note == '\0')
|
if (bd->note == NULL || *bd->note == '\0')
|
||||||
note = cmd_list_print(bd->cmdlist, 1);
|
note = cmd_list_print(bd->cmdlist,
|
||||||
|
CMD_LIST_PRINT_ESCAPED|CMD_LIST_PRINT_NO_GROUPS);
|
||||||
else
|
else
|
||||||
note = xstrdup(bd->note);
|
note = xstrdup(bd->note);
|
||||||
tmp = utf8_padcstr(key, keywidth + 1);
|
tmp = utf8_padcstr(key, keywidth + 1);
|
||||||
@@ -288,7 +289,8 @@ cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
tmpused = strlcat(tmp, " ", tmpsize);
|
tmpused = strlcat(tmp, " ", tmpsize);
|
||||||
free(cp);
|
free(cp);
|
||||||
|
|
||||||
cp = cmd_list_print(bd->cmdlist, 1);
|
cp = cmd_list_print(bd->cmdlist,
|
||||||
|
CMD_LIST_PRINT_ESCAPED|CMD_LIST_PRINT_NO_GROUPS);
|
||||||
cplen = strlen(cp);
|
cplen = strlen(cp);
|
||||||
while (tmpused + cplen + 1 >= tmpsize) {
|
while (tmpused + cplen + 1 >= tmpsize) {
|
||||||
tmpsize *= 2;
|
tmpsize *= 2;
|
||||||
|
|||||||
6
cmd.c
6
cmd.c
@@ -676,12 +676,14 @@ cmd_list_copy(const struct cmd_list *cmdlist, int argc, char **argv)
|
|||||||
|
|
||||||
/* Get a command list as a string. */
|
/* Get a command list as a string. */
|
||||||
char *
|
char *
|
||||||
cmd_list_print(const struct cmd_list *cmdlist, int escaped)
|
cmd_list_print(const struct cmd_list *cmdlist, int flags)
|
||||||
{
|
{
|
||||||
struct cmd *cmd, *next;
|
struct cmd *cmd, *next;
|
||||||
char *buf, *this;
|
char *buf, *this;
|
||||||
size_t len;
|
size_t len;
|
||||||
const char *separator;
|
const char *separator;
|
||||||
|
int escaped = flags & CMD_LIST_PRINT_ESCAPED;
|
||||||
|
int no_groups = flags & CMD_LIST_PRINT_NO_GROUPS;
|
||||||
const char *single_separator = escaped ? " \\; " : " ; ";
|
const char *single_separator = escaped ? " \\; " : " ; ";
|
||||||
const char *double_separator = escaped ? " \\;\\; " : " ;; ";
|
const char *double_separator = escaped ? " \\;\\; " : " ;; ";
|
||||||
|
|
||||||
@@ -698,7 +700,7 @@ cmd_list_print(const struct cmd_list *cmdlist, int escaped)
|
|||||||
|
|
||||||
next = TAILQ_NEXT(cmd, qentry);
|
next = TAILQ_NEXT(cmd, qentry);
|
||||||
if (next != NULL) {
|
if (next != NULL) {
|
||||||
if (cmd->group != next->group)
|
if (!no_groups && cmd->group != next->group)
|
||||||
separator = double_separator;
|
separator = double_separator;
|
||||||
else
|
else
|
||||||
separator = single_separator;
|
separator = single_separator;
|
||||||
|
|||||||
2
input.c
2
input.c
@@ -3434,6 +3434,8 @@ input_report_current_theme(struct input_ctx *ictx)
|
|||||||
{
|
{
|
||||||
struct window_pane *wp = ictx->wp;
|
struct window_pane *wp = ictx->wp;
|
||||||
|
|
||||||
|
if (wp == NULL)
|
||||||
|
return;
|
||||||
switch (window_pane_get_theme(wp)) {
|
switch (window_pane_get_theme(wp)) {
|
||||||
case THEME_DARK:
|
case THEME_DARK:
|
||||||
log_debug("%s: %%%u dark theme", __func__, wp->id);
|
log_debug("%s: %%%u dark theme", __func__, wp->id);
|
||||||
|
|||||||
2
tmux.h
2
tmux.h
@@ -2734,6 +2734,8 @@ void cmd_list_append(struct cmd_list *, struct cmd *);
|
|||||||
void cmd_list_append_all(struct cmd_list *, struct cmd_list *);
|
void cmd_list_append_all(struct cmd_list *, struct cmd_list *);
|
||||||
void cmd_list_move(struct cmd_list *, struct cmd_list *);
|
void cmd_list_move(struct cmd_list *, struct cmd_list *);
|
||||||
void cmd_list_free(struct cmd_list *);
|
void cmd_list_free(struct cmd_list *);
|
||||||
|
#define CMD_LIST_PRINT_ESCAPED 0x1
|
||||||
|
#define CMD_LIST_PRINT_NO_GROUPS 0x2
|
||||||
char *cmd_list_print(const struct cmd_list *, int);
|
char *cmd_list_print(const struct cmd_list *, int);
|
||||||
struct cmd *cmd_list_first(struct cmd_list *);
|
struct cmd *cmd_list_first(struct cmd_list *);
|
||||||
struct cmd *cmd_list_next(struct cmd *);
|
struct cmd *cmd_list_next(struct cmd *);
|
||||||
|
|||||||
Reference in New Issue
Block a user