mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 13:58:18 +00:00
refactor(api): consistent VALIDATE messages #22262
Problem: Validation messages are not consistently formatted. - Parameter names sometimes are NOT quoted. - Descriptive names (non-parameters) sometimes ARE quoted. Solution: Always quote the `name` value passed to a VALIDATE macro _unless_ the value has whitespace.
This commit is contained in:
@@ -207,7 +207,7 @@ Boolean nvim_buf_attach(uint64_t channel_id, Buffer buffer, Boolean send_buffer,
|
||||
}
|
||||
}
|
||||
|
||||
VALIDATE_S(key_used, "key", k.data, {
|
||||
VALIDATE_S(key_used, "'opts' key", k.data, {
|
||||
goto error;
|
||||
});
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ void nvim_buf_delete(Buffer buffer, Dictionary opts, Error *err)
|
||||
} else if (strequal("unload", k.data)) {
|
||||
unload = api_object_to_bool(v, "unload", false, err);
|
||||
} else {
|
||||
VALIDATE_S(false, "key", k.data, {
|
||||
VALIDATE_S(false, "'opts' key", k.data, {
|
||||
return;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user