0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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 #5402)
This commit is contained in:
Bram Moolenaar
2019-12-27 17:20:55 +01:00
parent 5c463a28ff
commit 297610ba4b
8 changed files with 64 additions and 1 deletions

View File

@@ -5341,10 +5341,18 @@ help_compare(const void *s1, const void *s2)
{
char *p1;
char *p2;
int cmp;
p1 = *(char **)s1 + strlen(*(char **)s1) + 1;
p2 = *(char **)s2 + strlen(*(char **)s2) + 1;
return strcmp(p1, p2);
// Compare by help heuristic number first.
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);
}
/*