mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: Small section missed from previous. Add modal panes, created currently with new-pane -O. There is one modal pane per window and it must be a floating pane. These are intended to replace popups. Currently a modal pane will unzoom a zoomed window and rezoom it when it is closed (a bit like modes do), but this is planned to change when we get an always-on-top flag.
This commit is contained in:
31
format.c
31
format.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: format.c,v 1.404 2026/07/14 15:06:54 nicm Exp $ */
|
||||
/* $OpenBSD: format.c,v 1.405 2026/07/15 13:02:33 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -1088,6 +1088,20 @@ format_cb_pane_floating_flag(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_modal_flag. */
|
||||
static void *
|
||||
format_cb_pane_modal_flag(struct format_tree *ft)
|
||||
{
|
||||
struct window_pane *wp = ft->wp;
|
||||
|
||||
if (wp != NULL) {
|
||||
if (wp == wp->window->modal)
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_bg. */
|
||||
static void *
|
||||
format_cb_pane_bg(struct format_tree *ft)
|
||||
@@ -3102,6 +3116,15 @@ format_cb_window_marked_flag(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for window_modal_pane. */
|
||||
static void *
|
||||
format_cb_window_modal_pane(struct format_tree *ft)
|
||||
{
|
||||
if (ft->w != NULL && ft->w->modal != NULL)
|
||||
return (format_printf("%%%u", ft->w->modal->id));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for window_name. */
|
||||
static void *
|
||||
format_cb_window_name(struct format_tree *ft)
|
||||
@@ -3684,6 +3707,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "pane_marked_set", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_marked_set
|
||||
},
|
||||
{ "pane_modal_flag", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_modal_flag
|
||||
},
|
||||
{ "pane_mode", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_mode
|
||||
},
|
||||
@@ -3942,6 +3968,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "window_marked_flag", FORMAT_TABLE_STRING,
|
||||
format_cb_window_marked_flag
|
||||
},
|
||||
{ "window_modal_pane", FORMAT_TABLE_STRING,
|
||||
format_cb_window_modal_pane
|
||||
},
|
||||
{ "window_name", FORMAT_TABLE_STRING,
|
||||
format_cb_window_name
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user