Patch 8.2.1055
Problem: No filetype set for pacman config files.
Solution: Recognize pacman.conf and *.hook. (Guido Cella, closes #6335)
Files: runtime/filetype.vim, src/testdir/test_filetype.vim
*** ../vim-8.2.1054/runtime/filetype.vim 2020-06-23 21:01:19.398080502 +0200
--- runtime/filetype.vim 2020-06-25 19:51:51.778868285 +0200
***************
*** 1134,1141 ****
" Packet filter conf
au BufNewFile,BufRead pf.conf setf pf
" Pam conf
! au BufNewFile,BufRead */etc/pam.conf setf pamconf
" Pam environment
au BufNewFile,BufRead pam_env.conf,.pam_environment setf pamenv
--- 1134,1150 ----
" Packet filter conf
au BufNewFile,BufRead pf.conf setf pf
+ " Pacman Config (close enough to dosini)
+ au BufNewFile,BufRead */etc/pacman.conf setf dosini
+
+ " Pacman hooks
+ au BufNewFile,BufRead *.hook
+ \ if getline(1) == '[Trigger]' |
+ \ setf dosini |
+ \ endif
+
" Pam conf
! au BufNewFile,BufRead */etc/pam.conf setf pamconf
" Pam environment
au BufNewFile,BufRead pam_env.conf,.pam_environment setf pamenv
*** ../vim-8.2.1054/src/testdir/test_filetype.vim 2020-06-23 21:01:19.398080502 +0200
--- src/testdir/test_filetype.vim 2020-06-25 19:52:42.462700444 +0200
***************
*** 139,145 ****
\ 'dnsmasq': ['/etc/dnsmasq.conf'],
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'],
\ 'dosbatch': ['file.bat', 'file.sys'],
! \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'],
\ 'dot': ['file.dot', 'file.gv'],
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
\ 'dsl': ['file.dsl'],
--- 139,145 ----
\ 'dnsmasq': ['/etc/dnsmasq.conf'],
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'],
\ 'dosbatch': ['file.bat', 'file.sys'],
! \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini'],
\ 'dot': ['file.dot', 'file.gv'],
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
\ 'dsl': ['file.dsl'],
***************
*** 665,668 ****
--- 665,686 ----
close
endfunc
+ func Test_hook_file()
+ filetype on
+
+ call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_equal('dosini', &filetype)
+ bwipe!
+
+ call writefile(['not pacman'], 'Xfile.hook')
+ split Xfile.hook
+ call assert_notequal('dosini', &filetype)
+ bwipe!
+
+ call delete('Xfile.hook')
+ filetype off
+ endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.1054/src/version.c 2020-06-25 19:27:53.036387595 +0200
--- src/version.c 2020-06-25 19:46:30.299948144 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1055,
/**/
--
It is illegal for a driver to be blindfolded while operating a vehicle.
[real standing law in Alabama, United States of America]
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///