diff options
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r-- | sway/commands/move.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c index 9e40a3b4..69ed06c0 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c | |||
@@ -470,7 +470,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth, | |||
470 | if (strcasecmp(argv[1], "number") == 0) { | 470 | if (strcasecmp(argv[1], "number") == 0) { |
471 | // move [window|container] [to] "workspace number x" | 471 | // move [window|container] [to] "workspace number x" |
472 | if (argc < 3) { | 472 | if (argc < 3) { |
473 | return cmd_results_new(CMD_INVALID, expected_syntax); | 473 | return cmd_results_new(CMD_INVALID, "%s", expected_syntax); |
474 | } | 474 | } |
475 | if (!isdigit(argv[2][0])) { | 475 | if (!isdigit(argv[2][0])) { |
476 | return cmd_results_new(CMD_INVALID, | 476 | return cmd_results_new(CMD_INVALID, |
@@ -530,7 +530,7 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth, | |||
530 | } | 530 | } |
531 | destination = &dest_con->node; | 531 | destination = &dest_con->node; |
532 | } else { | 532 | } else { |
533 | return cmd_results_new(CMD_INVALID, expected_syntax); | 533 | return cmd_results_new(CMD_INVALID, "%s", expected_syntax); |
534 | } | 534 | } |
535 | 535 | ||
536 | if (destination->type == N_CONTAINER && | 536 | if (destination->type == N_CONTAINER && |
@@ -829,7 +829,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
829 | } | 829 | } |
830 | 830 | ||
831 | if (!argc) { | 831 | if (!argc) { |
832 | return cmd_results_new(CMD_INVALID, expected_position_syntax); | 832 | return cmd_results_new(CMD_INVALID, "%s", expected_position_syntax); |
833 | } | 833 | } |
834 | 834 | ||
835 | bool absolute = false; | 835 | bool absolute = false; |
@@ -839,19 +839,19 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
839 | ++argv; | 839 | ++argv; |
840 | } | 840 | } |
841 | if (!argc) { | 841 | if (!argc) { |
842 | return cmd_results_new(CMD_INVALID, expected_position_syntax); | 842 | return cmd_results_new(CMD_INVALID, "%s", expected_position_syntax); |
843 | } | 843 | } |
844 | if (strcmp(argv[0], "position") == 0) { | 844 | if (strcmp(argv[0], "position") == 0) { |
845 | --argc; | 845 | --argc; |
846 | ++argv; | 846 | ++argv; |
847 | } | 847 | } |
848 | if (!argc) { | 848 | if (!argc) { |
849 | return cmd_results_new(CMD_INVALID, expected_position_syntax); | 849 | return cmd_results_new(CMD_INVALID, "%s", expected_position_syntax); |
850 | } | 850 | } |
851 | if (strcmp(argv[0], "cursor") == 0 || strcmp(argv[0], "mouse") == 0 || | 851 | if (strcmp(argv[0], "cursor") == 0 || strcmp(argv[0], "mouse") == 0 || |
852 | strcmp(argv[0], "pointer") == 0) { | 852 | strcmp(argv[0], "pointer") == 0) { |
853 | if (absolute) { | 853 | if (absolute) { |
854 | return cmd_results_new(CMD_INVALID, expected_position_syntax); | 854 | return cmd_results_new(CMD_INVALID, "%s", expected_position_syntax); |
855 | } | 855 | } |
856 | return cmd_move_to_position_pointer(container); | 856 | return cmd_move_to_position_pointer(container); |
857 | } else if (strcmp(argv[0], "center") == 0) { | 857 | } else if (strcmp(argv[0], "center") == 0) { |
@@ -873,7 +873,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
873 | } | 873 | } |
874 | 874 | ||
875 | if (argc < 2) { | 875 | if (argc < 2) { |
876 | return cmd_results_new(CMD_FAILURE, expected_position_syntax); | 876 | return cmd_results_new(CMD_FAILURE, "%s", expected_position_syntax); |
877 | } | 877 | } |
878 | 878 | ||
879 | struct movement_amount lx = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID }; | 879 | struct movement_amount lx = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID }; |
@@ -886,7 +886,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
886 | } | 886 | } |
887 | 887 | ||
888 | if (argc < 1) { | 888 | if (argc < 1) { |
889 | return cmd_results_new(CMD_FAILURE, expected_position_syntax); | 889 | return cmd_results_new(CMD_FAILURE, "%s", expected_position_syntax); |
890 | } | 890 | } |
891 | 891 | ||
892 | struct movement_amount ly = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID }; | 892 | struct movement_amount ly = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID }; |
@@ -895,7 +895,7 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) { | |||
895 | argc -= num_consumed_args; | 895 | argc -= num_consumed_args; |
896 | argv += num_consumed_args; | 896 | argv += num_consumed_args; |
897 | if (argc > 0) { | 897 | if (argc > 0) { |
898 | return cmd_results_new(CMD_INVALID, expected_position_syntax); | 898 | return cmd_results_new(CMD_INVALID, "%s", expected_position_syntax); |
899 | } | 899 | } |
900 | if (ly.unit == MOVEMENT_UNIT_INVALID) { | 900 | if (ly.unit == MOVEMENT_UNIT_INVALID) { |
901 | return cmd_results_new(CMD_INVALID, "Invalid y position specified"); | 901 | return cmd_results_new(CMD_INVALID, "Invalid y position specified"); |
@@ -1041,13 +1041,13 @@ struct cmd_results *cmd_move(int argc, char **argv) { | |||
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | if (!argc) { | 1043 | if (!argc) { |
1044 | return cmd_results_new(CMD_INVALID, expected_full_syntax); | 1044 | return cmd_results_new(CMD_INVALID, "%s", expected_full_syntax); |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | // Only `move [window|container] [to] workspace` supports | 1047 | // Only `move [window|container] [to] workspace` supports |
1048 | // `--no-auto-back-and-forth` so treat others as invalid syntax | 1048 | // `--no-auto-back-and-forth` so treat others as invalid syntax |
1049 | if (no_auto_back_and_forth && strcasecmp(argv[0], "workspace") != 0) { | 1049 | if (no_auto_back_and_forth && strcasecmp(argv[0], "workspace") != 0) { |
1050 | return cmd_results_new(CMD_INVALID, expected_full_syntax); | 1050 | return cmd_results_new(CMD_INVALID, "%s", expected_full_syntax); |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | if (strcasecmp(argv[0], "workspace") == 0 || | 1053 | if (strcasecmp(argv[0], "workspace") == 0 || |
@@ -1061,5 +1061,5 @@ struct cmd_results *cmd_move(int argc, char **argv) { | |||
1061 | strcasecmp(argv[1], "position") == 0)) { | 1061 | strcasecmp(argv[1], "position") == 0)) { |
1062 | return cmd_move_to_position(argc, argv); | 1062 | return cmd_move_to_position(argc, argv); |
1063 | } | 1063 | } |
1064 | return cmd_results_new(CMD_INVALID, expected_full_syntax); | 1064 | return cmd_results_new(CMD_INVALID, "%s", expected_full_syntax); |
1065 | } | 1065 | } |