mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor: use ERROR_SET() to check for error (#30594)
Replaces the only two places where kErrorTypeNone is checked explicitly.
This commit is contained in:
parent
888966652d
commit
e0efbc6e03
@ -3181,7 +3181,7 @@ bool map_execute_lua(bool may_repeat)
|
|||||||
Error err = ERROR_INIT;
|
Error err = ERROR_INIT;
|
||||||
Array args = ARRAY_DICT_INIT;
|
Array args = ARRAY_DICT_INIT;
|
||||||
nlua_call_ref(ref, NULL, args, kRetNilBool, NULL, &err);
|
nlua_call_ref(ref, NULL, args, kRetNilBool, NULL, &err);
|
||||||
if (err.type != kErrorTypeNone) {
|
if (ERROR_SET(&err)) {
|
||||||
semsg_multiline("E5108: %s", err.msg);
|
semsg_multiline("E5108: %s", err.msg);
|
||||||
api_clear_error(&err);
|
api_clear_error(&err);
|
||||||
}
|
}
|
||||||
|
@ -1651,7 +1651,7 @@ char *eval_map_expr(mapblock_T *mp, int c)
|
|||||||
p = string_to_cstr(ret.data.string);
|
p = string_to_cstr(ret.data.string);
|
||||||
}
|
}
|
||||||
api_free_object(ret);
|
api_free_object(ret);
|
||||||
if (err.type != kErrorTypeNone) {
|
if (ERROR_SET(&err)) {
|
||||||
semsg_multiline("E5108: %s", err.msg);
|
semsg_multiline("E5108: %s", err.msg);
|
||||||
api_clear_error(&err);
|
api_clear_error(&err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user