patch 9.1.1304: filetype: some man files are not recognized

Problem:  filetype: some man files are not recognized
          (e.g. 1p (POSIX commands))
Solution: update the filetype detection pattern and detect more man
          files as nroff (Eisuke Kawashima)

- sections are revised referring to
    - debian-12:/etc/manpath.config
    - fedora-41:/etc/man_db.conf
- detection logic is improved
- detection test is implemented

closes: #17117

Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Eisuke Kawashima
2025-04-15 18:30:05 +02:00
committed by Christian Brabandt
parent d62377386c
commit babdb0554a
4 changed files with 28 additions and 8 deletions

View File

@ -2889,6 +2889,20 @@ func Test_map_file()
filetype off
endfunc
func Test_nroff_file()
filetype on
call writefile(['.TH vim 1 "YYYY Mth DD"'], 'Xfile.1', 'D')
split Xfile.1
call assert_equal('nroff', &filetype)
bwipe!
call writefile(['. /etc/profile'], 'Xfile.1', 'D')
split Xfile.1
call assert_notequal('nroff', &filetype)
bwipe!
endfunc
func Test_org_file()
filetype on

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1304,
/**/
1303,
/**/