0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3992: wrong local-additions in the help with language mix

Problem:    Wrong local-additions in the help with language mix.
Solution:   Adjust how the local additions list is generated. (Hirohito
            Higashi, closes #9464)
This commit is contained in:
h-east
2022-01-03 12:53:24 +00:00
committed by Bram Moolenaar
parent 114dbda785
commit 0e2508d9e6
3 changed files with 50 additions and 23 deletions

View File

@@ -818,32 +818,31 @@ fix_help_buffer(void)
// the same directory.
for (i1 = 0; i1 < fcount; ++i1)
{
for (i2 = 0; i2 < fcount; ++i2)
f1 = fnames[i1];
t1 = gettail(f1);
e1 = vim_strrchr(t1, '.');
if (fnamecmp(e1, ".txt") != 0
&& fnamecmp(e1, fname + 4) != 0)
{
// Not .txt and not .abx, remove it.
VIM_CLEAR(fnames[i1]);
continue;
}
for (i2 = i1 + 1; i2 < fcount; ++i2)
{
if (i1 == i2)
continue;
if (fnames[i1] == NULL || fnames[i2] == NULL)
continue;
f1 = fnames[i1];
f2 = fnames[i2];
t1 = gettail(f1);
if (f2 == NULL)
continue;
t2 = gettail(f2);
e1 = vim_strrchr(t1, '.');
e2 = vim_strrchr(t2, '.');
if (e1 == NULL || e2 == NULL)
continue;
if (fnamecmp(e1, ".txt") != 0
&& fnamecmp(e1, fname + 4) != 0)
{
// Not .txt and not .abx, remove it.
VIM_CLEAR(fnames[i1]);
continue;
}
if (e1 - f1 != e2 - f2
|| fnamencmp(f1, f2, e1 - f1) != 0)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)
&& fnamecmp(e2, fname + 4) == 0)
// use .abx instead of .txt
VIM_CLEAR(fnames[i1]);
}