commit b3f9da9524b0b1bb992d3dd84eaa92980923cb3e
parent feaab21c71b9c47e20ed88649bdd79b69c3806da
Author: Will Hopkins <willothyh@gmail.com>
Date: Mon, 1 Apr 2024 21:48:21 -0700
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
@@ -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;