diff options
author | rsgowman <richard.gowman@gmail.com> | 2024-02-06 14:28:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 20:28:20 +0100 |
commit | 6a530de22049d7ce8575d1fdd393654260a25234 (patch) | |
tree | 6e1184fad02a2cc3149abd3e5f2eba57f89ee867 /src/con.c | |
parent | 063916718505162b5ebe22268e413787cba32642 (diff) | |
download | i3-6a530de22049d7ce8575d1fdd393654260a25234.tar.gz i3-6a530de22049d7ce8575d1fdd393654260a25234.zip |
Create new workspaces to the right of existing ones with the same number
i.e. creating workspaces named "1", "2:a", "2:b", "3" should result in
that same order rather than "1", "2:b", "2:a", "3".
Diffstat (limited to 'src/con.c')
-rw-r--r-- | src/con.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -116,14 +116,14 @@ static void _con_attach(Con *con, Con *parent, Con *previous, bool ignore_focus) /* we need to insert the container at the beginning */ TAILQ_INSERT_HEAD(nodes_head, con, nodes); } else { - while (current->num != -1 && con->num > current->num) { + while (current->num != -1 && con->num >= current->num) { current = TAILQ_NEXT(current, nodes); if (current == TAILQ_END(nodes_head)) { current = NULL; break; } } - /* we need to insert con after current, if current is not NULL */ + /* we need to insert con before current, if current is not NULL */ if (current) { TAILQ_INSERT_BEFORE(current, con, nodes); } else { |