mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
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:
parent
feaab21c71
commit
b3f9da9524
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user