mirror of
https://github.com/tmux/tmux.git
synced 2025-04-23 21:08:48 +00:00
Add a format to show if there are unseen changes while in a mode, from
Dan Aloni in GitHub issue 3498.
This commit is contained in:
parent
d73078838d
commit
c21af7e446
15
format.c
15
format.c
@ -1885,6 +1885,18 @@ format_cb_pane_input_off(struct format_tree *ft)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Callback for pane_unseen_changes. */
|
||||||
|
static void *
|
||||||
|
format_cb_pane_unseen_changes(struct format_tree *ft)
|
||||||
|
{
|
||||||
|
if (ft->wp != NULL) {
|
||||||
|
if (ft->wp->flags & PANE_UNSEENCHANGES)
|
||||||
|
return (xstrdup("1"));
|
||||||
|
return (xstrdup("0"));
|
||||||
|
}
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* Callback for pane_last. */
|
/* Callback for pane_last. */
|
||||||
static void *
|
static void *
|
||||||
format_cb_pane_last(struct format_tree *ft)
|
format_cb_pane_last(struct format_tree *ft)
|
||||||
@ -2953,6 +2965,9 @@ static const struct format_table_entry format_table[] = {
|
|||||||
{ "pane_tty", FORMAT_TABLE_STRING,
|
{ "pane_tty", FORMAT_TABLE_STRING,
|
||||||
format_cb_pane_tty
|
format_cb_pane_tty
|
||||||
},
|
},
|
||||||
|
{ "pane_unseen_changes", FORMAT_TABLE_STRING,
|
||||||
|
format_cb_pane_unseen_changes
|
||||||
|
},
|
||||||
{ "pane_width", FORMAT_TABLE_STRING,
|
{ "pane_width", FORMAT_TABLE_STRING,
|
||||||
format_cb_pane_width
|
format_cb_pane_width
|
||||||
},
|
},
|
||||||
|
4
input.c
4
input.c
@ -971,6 +971,10 @@ input_parse_buffer(struct window_pane *wp, u_char *buf, size_t len)
|
|||||||
window_update_activity(wp->window);
|
window_update_activity(wp->window);
|
||||||
wp->flags |= PANE_CHANGED;
|
wp->flags |= PANE_CHANGED;
|
||||||
|
|
||||||
|
/* Flag new input while in a mode. */
|
||||||
|
if (!TAILQ_EMPTY(&wp->modes))
|
||||||
|
wp->flags |= PANE_UNSEENCHANGES;
|
||||||
|
|
||||||
/* NULL wp if there is a mode set as don't want to update the tty. */
|
/* NULL wp if there is a mode set as don't want to update the tty. */
|
||||||
if (TAILQ_EMPTY(&wp->modes))
|
if (TAILQ_EMPTY(&wp->modes))
|
||||||
screen_write_start_pane(sctx, wp, &wp->base);
|
screen_write_start_pane(sctx, wp, &wp->base);
|
||||||
|
1
tmux.1
1
tmux.1
@ -5257,6 +5257,7 @@ The following variables are available, where appropriate:
|
|||||||
.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
|
.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
|
||||||
.It Li "pane_top" Ta "" Ta "Top of pane"
|
.It Li "pane_top" Ta "" Ta "Top of pane"
|
||||||
.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
|
.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
|
||||||
|
.It Li "pane_unseen_changes" Ta "" Ta "1 if there were changes in pane while in mode"
|
||||||
.It Li "pane_width" Ta "" Ta "Width of pane"
|
.It Li "pane_width" Ta "" Ta "Width of pane"
|
||||||
.It Li "pid" Ta "" Ta "Server PID"
|
.It Li "pid" Ta "" Ta "Server PID"
|
||||||
.It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
|
.It Li "rectangle_toggle" Ta "" Ta "1 if rectangle selection is activated"
|
||||||
|
1
tmux.h
1
tmux.h
@ -1045,6 +1045,7 @@ struct window_pane {
|
|||||||
#define PANE_STATUSDRAWN 0x400
|
#define PANE_STATUSDRAWN 0x400
|
||||||
#define PANE_EMPTY 0x800
|
#define PANE_EMPTY 0x800
|
||||||
#define PANE_STYLECHANGED 0x1000
|
#define PANE_STYLECHANGED 0x1000
|
||||||
|
#define PANE_UNSEENCHANGES 0x2000
|
||||||
|
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
1
window.c
1
window.c
@ -1120,6 +1120,7 @@ window_pane_reset_mode(struct window_pane *wp)
|
|||||||
|
|
||||||
next = TAILQ_FIRST(&wp->modes);
|
next = TAILQ_FIRST(&wp->modes);
|
||||||
if (next == NULL) {
|
if (next == NULL) {
|
||||||
|
wp->flags &= ~PANE_UNSEENCHANGES;
|
||||||
log_debug("%s: no next mode", __func__);
|
log_debug("%s: no next mode", __func__);
|
||||||
wp->screen = &wp->base;
|
wp->screen = &wp->base;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user