Revert "Workspace command number selection"
This reverts commit cbd51ce664
.
If you’ve started using this feature, I’m very sorry, but I think it’s
better to revert it entirely, as it will only cause more problems in the
future as more and more people upgrade and get bitten by this if we
didn’t revert it…
fixes #1536
This commit is contained in:
@ -494,27 +494,7 @@ void cmd_move_con_to_workspace_name(I3_CMD, char *name) {
|
||||
|
||||
LOG("should move window to workspace %s\n", name);
|
||||
/* get the workspace */
|
||||
Con *ws = NULL;
|
||||
Con *output = NULL;
|
||||
|
||||
/* first look for a workspace with this name */
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
|
||||
GREP_FIRST(ws, output_get_content(output), !strcasecmp(child->name, name));
|
||||
}
|
||||
|
||||
/* if the name is plain digits, we interpret this as a "workspace number"
|
||||
* command */
|
||||
if (!ws && name_is_digits(name)) {
|
||||
long parsed_num = ws_name_to_number(name);
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
|
||||
GREP_FIRST(ws, output_get_content(output),
|
||||
child->num == parsed_num);
|
||||
}
|
||||
}
|
||||
|
||||
/* if no workspace was found, make a new one */
|
||||
if (!ws)
|
||||
ws = workspace_get(name, NULL);
|
||||
Con *ws = workspace_get(name, NULL);
|
||||
|
||||
ws = maybe_auto_back_and_forth_workspace(ws);
|
||||
|
||||
@ -1049,30 +1029,7 @@ void cmd_workspace_name(I3_CMD, char *name) {
|
||||
DLOG("should switch to workspace %s\n", name);
|
||||
if (maybe_back_and_forth(cmd_output, name))
|
||||
return;
|
||||
|
||||
Con *ws = NULL;
|
||||
Con *output = NULL;
|
||||
|
||||
/* first look for a workspace with this name */
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
|
||||
GREP_FIRST(ws, output_get_content(output), !strcasecmp(child->name, name));
|
||||
}
|
||||
|
||||
/* if the name is only digits, we interpret this as a "workspace number"
|
||||
* command */
|
||||
if (!ws && name_is_digits(name)) {
|
||||
long parsed_num = ws_name_to_number(name);
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
|
||||
GREP_FIRST(ws, output_get_content(output),
|
||||
child->num == parsed_num);
|
||||
}
|
||||
}
|
||||
|
||||
/* if no workspace was found, make a new one */
|
||||
if (!ws)
|
||||
ws = workspace_get(name, NULL);
|
||||
|
||||
workspace_show(ws);
|
||||
workspace_show_by_name(name);
|
||||
|
||||
cmd_output->needs_tree_render = true;
|
||||
// XXX: default reply for now, make this a better reply
|
||||
|
Reference in New Issue
Block a user