mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:9.0.0299: error messages for setcmdline() could be better (#20169)
Problem: Error messages for setcmdline() could be better.
Solution: Use more specific error messages. (Yegappan Lakshmanan,
closes vim/vim#10995)
25f1e55562
Cherry-pick tv_check_for_opt_number_arg() from Vim.
This commit is contained in:
@@ -3843,6 +3843,14 @@ int tv_check_for_number_arg(const typval_T *const args, const int idx)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/// Check for an optional number argument at "idx"
|
||||
int tv_check_for_opt_number_arg(const typval_T *const args, const int idx)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE
|
||||
{
|
||||
return (args[idx].v_type == VAR_UNKNOWN
|
||||
|| tv_check_for_number_arg(args, idx) != FAIL) ? OK : FAIL;
|
||||
}
|
||||
|
||||
/// Get the string value of a "stringish" VimL object.
|
||||
///
|
||||
/// @param[in] tv Object to get value of.
|
||||
|
Reference in New Issue
Block a user