summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/actions.c b/src/actions.c
index c1e8ac3..d51f326 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -3596,21 +3596,26 @@ cmd_groups (int interactive, char *data)
char *
cmd_gmove (int interactive, char *data)
{
+ char *str;
rp_group *g;
- if (data == NULL)
- {
- message (" gmove: one argument required ");
- return NULL;
- }
-
if (current_window() == NULL)
{
message (" gmove: no focused window ");
return NULL;
}
- g = find_group (data);
+ /* Prompt for a group */
+ if (data == NULL)
+ str = get_input (MESSAGE_PROMPT_SWITCH_TO_GROUP, group_completions);
+ else
+ str = xstrdup (data);
+
+ /* User aborted. */
+ if (str == NULL)
+ return NULL;
+
+ g = find_group (str);
if (g == NULL)
{
message (" gmove: cannot find group ");