Fix default workspace name generation

This fixes the issue where workspace 10 ends up being the default.
This commit is contained in:
Drew DeVault 2015-12-18 18:52:14 -05:00
parent 2ab4e5676e
commit 7647762bab
3 changed files with 29 additions and 16 deletions

View file

@ -167,6 +167,8 @@ static struct cmd_results *checkarg(int argc, const char *name, enum expected_ar
return error;
}
int binding_order = 0;
static struct cmd_results *cmd_bindsym(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "bindsym", EXPECTED_MORE_THAN, 1))) {
@ -215,6 +217,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) {
free_sway_binding(dup);
list_del(mode->bindings, i);
}
binding->order = binding_order++;
list_add(mode->bindings, binding);
list_sort(mode->bindings, sway_binding_cmp);