patch 9.1.1606: filetype: a few more files are not recognized
Problem: filetype: a few more files are not recognized
Solution: guess Mail, Info and Terminfo files by its content
(lacygoill)
closes: #17880
Signed-off-by: lacygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
8a65a49d50
commit
eb2aebeb79
@ -3024,6 +3024,39 @@ func Test_org_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_info_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['File: coreutils.info, Node: Top, Next: Introduction, Up: (dir)', 'D'], 'Xfile', 'D')
|
||||
split Xfile
|
||||
call assert_equal('info', &filetype)
|
||||
bwipe!
|
||||
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_mail_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['Return-path: <lgc@debian.home.arpa>', 'D'], 'Xfile', 'D')
|
||||
split Xfile
|
||||
call assert_equal('mail', &filetype)
|
||||
bwipe!
|
||||
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_terminfo_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['# Reconstructed via infocmp from file: /etc/terminfo/x/xterm', 'D'], 'Xfile', 'D')
|
||||
split Xfile
|
||||
call assert_equal('terminfo', &filetype)
|
||||
bwipe!
|
||||
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" Filetypes detected from names of existing files
|
||||
func Test_pacmanlog()
|
||||
filetype on
|
||||
|
||||
@ -719,6 +719,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1606,
|
||||
/**/
|
||||
1605,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user