diff options
author | nicm <nicm> | 2023-03-27 08:47:57 +0000 |
---|---|---|
committer | nicm <nicm> | 2023-03-27 08:47:57 +0000 |
commit | c21af7e446beafd27a7a0384186bc480fd2e126d (patch) | |
tree | e0b8f94f718c10be87d8f1fd9027ee973956d3f2 /format.c | |
parent | d73078838dc9cadb42e0f4762847806076684cc8 (diff) |
Add a format to show if there are unseen changes while in a mode, from
Dan Aloni in GitHub issue 3498.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1885,6 +1885,18 @@ format_cb_pane_input_off(struct format_tree *ft) 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. */ static void * 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, format_cb_pane_tty }, + { "pane_unseen_changes", FORMAT_TABLE_STRING, + format_cb_pane_unseen_changes + }, { "pane_width", FORMAT_TABLE_STRING, format_cb_pane_width }, |