diff options
author | cos <cos> | 2013-05-15 23:15:29 +0200 |
---|---|---|
committer | cos <cos> | 2013-05-15 23:15:29 +0200 |
commit | 3a8ba7e627a5948957c18fe81ae487628ce36648 (patch) | |
tree | acee1e1d4fba81c7866ba6dcf69a473223970987 | |
parent | 5201477cbcb276bd13ec07e3d57b8c6cefe8201a (diff) | |
download | ratpoison-3a8ba7e627a5948957c18fe81ae487628ce36648.zip |
Make group_add_new_group() sort groups numerically.
-rw-r--r-- | src/group.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/group.c b/src/group.c index 5246b33..872746c 100644 --- a/src/group.c +++ b/src/group.c @@ -94,8 +94,19 @@ rp_group * group_add_new_group (char *name) { rp_group *g; + rp_group *cur; g = group_new (numset_request (group_numset), name); + + list_for_each_entry (cur, &rp_groups, node) + { + if(cur->number > g->number) + { + list_add_tail (&g->node, &cur->node); + return g; + } + } + list_add_tail (&g->node, &rp_groups); return g; |