mirror of
https://github.com/tmux/tmux.git
synced 2025-03-13 21:58:48 +00:00
Tweak previous slightly so that current session is chosen if it is in
the group rather than first.
This commit is contained in:
parent
c1f62f1fde
commit
95850e1aca
5
format.c
5
format.c
@ -795,8 +795,11 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
|
|||||||
found = s;
|
found = s;
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
if (fe->value == NULL && fe->cb != NULL)
|
if (fe->value == NULL && fe->cb != NULL) {
|
||||||
fe->cb(ft, fe);
|
fe->cb(ft, fe);
|
||||||
|
if (fe->value == NULL)
|
||||||
|
fe->value = xstrdup("");
|
||||||
|
}
|
||||||
found = fe->value;
|
found = fe->value;
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
@ -399,9 +399,11 @@ window_tree_build(void *modedata, u_int sort_type, uint64_t *tag,
|
|||||||
{
|
{
|
||||||
struct window_tree_modedata *data = modedata;
|
struct window_tree_modedata *data = modedata;
|
||||||
struct session *s, **l;
|
struct session *s, **l;
|
||||||
struct session_group *sg;
|
struct session_group *sg, *current;
|
||||||
u_int n, i;
|
u_int n, i;
|
||||||
|
|
||||||
|
current = session_group_contains(data->fs.s);
|
||||||
|
|
||||||
for (i = 0; i < data->item_size; i++)
|
for (i = 0; i < data->item_size; i++)
|
||||||
window_tree_free_item(data->item_list[i]);
|
window_tree_free_item(data->item_list[i]);
|
||||||
free(data->item_list);
|
free(data->item_list);
|
||||||
@ -412,9 +414,11 @@ window_tree_build(void *modedata, u_int sort_type, uint64_t *tag,
|
|||||||
n = 0;
|
n = 0;
|
||||||
RB_FOREACH(s, sessions, &sessions) {
|
RB_FOREACH(s, sessions, &sessions) {
|
||||||
if (data->squash_groups &&
|
if (data->squash_groups &&
|
||||||
(sg = session_group_contains(s)) != NULL &&
|
(sg = session_group_contains(s)) != NULL) {
|
||||||
s != TAILQ_FIRST(&sg->sessions))
|
if ((sg == current && s != data->fs.s) ||
|
||||||
continue;
|
(sg != current && s != TAILQ_FIRST(&sg->sessions)))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
l = xreallocarray(l, n + 1, sizeof *l);
|
l = xreallocarray(l, n + 1, sizeof *l);
|
||||||
l[n++] = s;
|
l[n++] = s;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user