mirror of
https://github.com/tmux/tmux.git
synced 2026-04-16 03:56:28 +00:00
Bring some new formats from the floating panes work: pane_zoomed_flag,
pane_flags, pane_floating_flag. By Michael Grant.
This commit is contained in:
52
format.c
52
format.c
@@ -811,8 +811,8 @@ format_cb_window_layout(struct format_tree *ft)
|
||||
return (NULL);
|
||||
|
||||
if (w->saved_layout_root != NULL)
|
||||
return (layout_dump(w->saved_layout_root));
|
||||
return (layout_dump(w->layout_root));
|
||||
return (layout_dump(w, w->saved_layout_root));
|
||||
return (layout_dump(w, w->layout_root));
|
||||
}
|
||||
|
||||
/* Callback for window_visible_layout. */
|
||||
@@ -824,7 +824,7 @@ format_cb_window_visible_layout(struct format_tree *ft)
|
||||
if (w == NULL)
|
||||
return (NULL);
|
||||
|
||||
return (layout_dump(w->layout_root));
|
||||
return (layout_dump(w, w->layout_root));
|
||||
}
|
||||
|
||||
/* Callback for pane_start_command. */
|
||||
@@ -990,6 +990,29 @@ format_cb_pane_fg(struct format_tree *ft)
|
||||
return (xstrdup(colour_tostring(gc.fg)));
|
||||
}
|
||||
|
||||
/* Callback for pane_flags. */
|
||||
static void *
|
||||
format_cb_pane_flags(struct format_tree *ft)
|
||||
{
|
||||
if (ft->wp != NULL)
|
||||
return (xstrdup(window_pane_printable_flags(ft->wp)));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_floating_flag. */
|
||||
static void *
|
||||
format_cb_pane_floating_flag(struct format_tree *ft)
|
||||
{
|
||||
struct window_pane *wp = ft->wp;
|
||||
|
||||
if (wp != NULL) {
|
||||
if (wp->flags & PANE_FLOATING)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_bg. */
|
||||
static void *
|
||||
format_cb_pane_bg(struct format_tree *ft)
|
||||
@@ -2351,6 +2374,20 @@ format_cb_pane_width(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_zoomed_flag. */
|
||||
static void *
|
||||
format_cb_pane_zoomed_flag(struct format_tree *ft)
|
||||
{
|
||||
struct window_pane *wp = ft->wp;
|
||||
|
||||
if (wp != NULL) {
|
||||
if (wp->flags & PANE_ZOOMED)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for scroll_region_lower. */
|
||||
static void *
|
||||
format_cb_scroll_region_lower(struct format_tree *ft)
|
||||
@@ -3326,6 +3363,12 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "pane_fg", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_fg
|
||||
},
|
||||
{ "pane_flags", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_flags
|
||||
},
|
||||
{ "pane_floating_flag", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_floating_flag
|
||||
},
|
||||
{ "pane_format", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_format
|
||||
},
|
||||
@@ -3413,6 +3456,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "pane_width", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_width
|
||||
},
|
||||
{ "pane_zoomed_flag", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_zoomed_flag
|
||||
},
|
||||
{ "pid", FORMAT_TABLE_STRING,
|
||||
format_cb_pid
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user