mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
vim-patch:partial:9.0.1166: code is indented more than necessary (#21716)
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes vim/vim#11792)1cfb14aa97
Partial port as some highlight.c changes depend on previous patches. Cherry-pick fname_match() change from patch 8.2.4959. Omit internal_func_check_arg_types(): only used for Vim9 script. N/A patches for version.c: vim-patch:9.0.1167: EditorConfig files do not have their own filetype Problem: EditorConfig files do not have their own filetype. Solution: Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779)d41262ed06
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -2676,19 +2676,20 @@ static int arg_augroup_get(char **argp)
|
||||
{
|
||||
char *p;
|
||||
char *arg = *argp;
|
||||
int group = AUGROUP_ALL;
|
||||
|
||||
for (p = arg; *p && !ascii_iswhite(*p) && *p != '|'; p++) {}
|
||||
if (p > arg) {
|
||||
char *group_name = xstrnsave(arg, (size_t)(p - arg));
|
||||
group = augroup_find(group_name);
|
||||
if (group == AUGROUP_ERROR) {
|
||||
group = AUGROUP_ALL; // no match, use all groups
|
||||
} else {
|
||||
*argp = skipwhite(p); // match, skip over group name
|
||||
}
|
||||
xfree(group_name);
|
||||
if (p <= arg) {
|
||||
return AUGROUP_ALL;
|
||||
}
|
||||
|
||||
char *group_name = xstrnsave(arg, (size_t)(p - arg));
|
||||
int group = augroup_find(group_name);
|
||||
if (group == AUGROUP_ERROR) {
|
||||
group = AUGROUP_ALL; // no match, use all groups
|
||||
} else {
|
||||
*argp = skipwhite(p); // match, skip over group name
|
||||
}
|
||||
xfree(group_name);
|
||||
return group;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user