mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
Merge pull request #17663 from dundargoc/refactor/uncrustify
refactor: apply uncrustify
This commit is contained in:
@@ -63,26 +63,26 @@ Array nvim_get_autocmds(Dict(get_autocmds) *opts, Error *err)
|
||||
int group = 0;
|
||||
|
||||
switch (opts->group.type) {
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
group = augroup_find(opts->group.data.string.data);
|
||||
if (group < 0) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup passed.");
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup passed.");
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "group must be a string or an integer.");
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
group = augroup_find(opts->group.data.string.data);
|
||||
if (group < 0) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup passed.");
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup passed.");
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "group must be a string or an integer.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (opts->event.type != kObjectTypeNil) {
|
||||
@@ -415,28 +415,28 @@ Integer nvim_create_autocmd(uint64_t channel_id, Object event, Dict(create_autoc
|
||||
bool is_nested = api_object_to_bool(opts->nested, "nested", false, err);
|
||||
|
||||
switch (opts->group.type) {
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
au_group = augroup_find(opts->group.data.string.data);
|
||||
if (au_group == AUGROUP_ERROR) {
|
||||
api_set_error(err,
|
||||
kErrorTypeValidation,
|
||||
"invalid augroup: %s", opts->group.data.string.data);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
au_group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(au_group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer.");
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
au_group = augroup_find(opts->group.data.string.data);
|
||||
if (au_group == AUGROUP_ERROR) {
|
||||
api_set_error(err,
|
||||
kErrorTypeValidation,
|
||||
"invalid augroup: %s", opts->group.data.string.data);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
au_group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(au_group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (opts->pattern.type != kObjectTypeNil && opts->buffer.type != kObjectTypeNil) {
|
||||
@@ -659,28 +659,28 @@ void nvim_do_autocmd(Object event, Dict(do_autocmd) *opts, Error *err)
|
||||
}
|
||||
|
||||
switch (opts->group.type) {
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
au_group = augroup_find(opts->group.data.string.data);
|
||||
if (au_group == AUGROUP_ERROR) {
|
||||
api_set_error(err,
|
||||
kErrorTypeValidation,
|
||||
"invalid augroup: %s", opts->group.data.string.data);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
au_group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(au_group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer.");
|
||||
case kObjectTypeNil:
|
||||
break;
|
||||
case kObjectTypeString:
|
||||
au_group = augroup_find(opts->group.data.string.data);
|
||||
if (au_group == AUGROUP_ERROR) {
|
||||
api_set_error(err,
|
||||
kErrorTypeValidation,
|
||||
"invalid augroup: %s", opts->group.data.string.data);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case kObjectTypeInteger:
|
||||
au_group = (int)opts->group.data.integer;
|
||||
char *name = augroup_name(au_group);
|
||||
if (!augroup_exists(name)) {
|
||||
api_set_error(err, kErrorTypeValidation, "invalid augroup: %d", au_group);
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
api_set_error(err, kErrorTypeValidation, "'group' must be a string or an integer.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (opts->buffer.type != kObjectTypeNil) {
|
||||
|
@@ -965,8 +965,7 @@ void nvim_buf_set_keymap(uint64_t channel_id, Buffer buffer, String mode, String
|
||||
/// @see |nvim_del_keymap()|
|
||||
///
|
||||
/// @param buffer Buffer handle, or 0 for current buffer
|
||||
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode,
|
||||
String lhs, Error *err)
|
||||
void nvim_buf_del_keymap(uint64_t channel_id, Buffer buffer, String mode, String lhs, Error *err)
|
||||
FUNC_API_SINCE(6)
|
||||
{
|
||||
String rhs = { .data = "", .size = 0 };
|
||||
@@ -1380,8 +1379,8 @@ Object nvim_buf_call(Buffer buffer, LuaRef fun, Error *err)
|
||||
/// @param buffer Buffer handle, or 0 for current buffer.
|
||||
/// @param[out] err Error details, if any.
|
||||
/// @see nvim_add_user_command
|
||||
void nvim_buf_add_user_command(Buffer buffer, String name, Object command,
|
||||
Dict(user_command) *opts, Error *err)
|
||||
void nvim_buf_add_user_command(Buffer buffer, String name, Object command, Dict(user_command) *opts,
|
||||
Error *err)
|
||||
FUNC_API_SINCE(9)
|
||||
{
|
||||
buf_T *target_buf = find_buffer_by_handle(buffer, err);
|
||||
|
@@ -723,15 +723,15 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err)
|
||||
break;
|
||||
case 2:
|
||||
switch (numval) {
|
||||
case 0:
|
||||
case 1:
|
||||
rv = BOOLEAN_OBJ(numval);
|
||||
break;
|
||||
default:
|
||||
// Boolean options that return something other than 0 or 1 should return nil. Currently this
|
||||
// only applies to 'autoread' which uses -1 as a local value to indicate "unset"
|
||||
rv = NIL;
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
rv = BOOLEAN_OBJ(numval);
|
||||
break;
|
||||
default:
|
||||
// Boolean options that return something other than 0 or 1 should return nil. Currently this
|
||||
// only applies to 'autoread' which uses -1 as a local value to indicate "unset"
|
||||
rv = NIL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user