refactor: informative error msg for 'noautocmd' (#28147)

Problem: Attempting to set 'noautocmd' for an existing window throws an error
that just says "Invalid key: 'noautocmd'" which is not very helpful.
Solution: Explain that 'noautocmd' can't be used with existing windows.
This commit is contained in:
Will Hopkins 2024-04-01 21:48:21 -07:00 committed by GitHub
parent feaab21c71
commit b3f9da9524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1267,7 +1267,7 @@ static bool parse_float_config(Dict(win_config) *config, WinConfig *fconfig, boo
if (HAS_KEY_X(config, noautocmd)) {
if (!new_win) {
api_set_error(err, kErrorTypeValidation, "Invalid key: 'noautocmd'");
api_set_error(err, kErrorTypeValidation, "'noautocmd' cannot be used with existing windows");
return false;
}
fconfig->noautocmd = config->noautocmd;