diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2024-09-21 00:53:26 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2024-09-21 00:53:26 +0200 |
| commit | 2b917ed78c7a2cecc0b845f9ad243148969ec9b4 (patch) | |
| tree | c00b32b1ab63db6c37bf3be1d2a613caff3b87c8 | |
| parent | c501db9b197536d60e827641e7e1fb3597c70af0 (diff) | |
commands/gaps: Check config->reading instead
Checking if the config is not active or is reloading is just a
convoluted way of checking if the config is being read.
(cherry picked from commit 861dde100ab5536bea190b078c6c51adb6814be5)
| -rw-r--r-- | sway/commands/gaps.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c index 1deeb56e..7ac6fcff 100644 --- a/sway/commands/gaps.c +++ b/sway/commands/gaps.c @@ -215,15 +215,13 @@ 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 && !config_loading) { + if (argc == 4 && !config->reading) { return gaps_set_runtime(argc, argv); } - if (config_loading) { + if (config->reading) { return cmd_results_new(CMD_INVALID, "Expected %s", expected_defaults); } return cmd_results_new(CMD_INVALID, "Expected %s or %s", |
