sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 67866dc3785453ad0ac97d14858c9176cbcca966
parent 60df5cc9f80a64a594c81d6ec438e86f6e73cd0c
Author: mwenzkowski <29407878+mwenzkowski@users.noreply.github.com>
Date:   Sun,  4 Nov 2018 20:40:14 +0100

gaps: Improve error reporting

Always raise an error if the runtime only gaps command is found in the
config file.

Diffstat:
Msway/commands/gaps.c | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c @@ -149,16 +149,17 @@ struct cmd_results *cmd_gaps(int argc, char **argv) { return error; } + bool config_loading = !config->active || config->reloading; + if (argc == 2) { return gaps_set_defaults(argc, argv); } - if (argc == 4) { - if (config->active) { - return gaps_set_runtime(argc, argv); - } else { - return cmd_results_new(CMD_INVALID, "gaps", - "This syntax can only be used when sway is running"); - } + if (argc == 4 && !config_loading) { + return gaps_set_runtime(argc, argv); + } + if (config_loading) { + return cmd_results_new(CMD_INVALID, "gaps", + "Expected 'gaps inner|outer <px>'"); } return cmd_results_new(CMD_INVALID, "gaps", "Expected 'gaps inner|outer <px>' or "