vim-patch:8.2.0049: command line completion not fully tested

Problem:    Command line completion not fully tested.
Solution:   Add more test cases.  Make help sorting stable. (Dominique Pelle,
            closes vim/vim#5402)
297610ba4b
This commit is contained in:
zeertzjq
2022-07-01 10:54:41 +08:00
parent 2268a4147e
commit 300490f2e8
7 changed files with 55 additions and 1 deletions

View File

@@ -5019,7 +5019,15 @@ static int help_compare(const void *s1, const void *s2)
p1 = *(char **)s1 + strlen(*(char **)s1) + 1;
p2 = *(char **)s2 + strlen(*(char **)s2) + 1;
return strcmp(p1, p2);
// Compare by help heuristic number first.
int cmp = strcmp(p1, p2);
if (cmp != 0) {
return cmp;
}
// Compare by strings as tie-breaker when same heuristic number.
return strcmp(*(char **)s1, *(char **)s2);
}
/// Find all help tags matching "arg", sort them and return in matches[], with