comparison src/testdir/test_filetype.vim @ 21008:2cf49849e933 v8.2.1055

patch 8.2.1055: no filetype set for pacman config files Commit: https://github.com/vim/vim/commit/73b4465ba7f170c5a1701ad908144970e758b1f5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 25 19:53:24 2020 +0200 patch 8.2.1055: no filetype set for pacman config files Problem: No filetype set for pacman config files. Solution: Recognize pacman.conf and *.hook. (Guido Cella, closes https://github.com/vim/vim/issues/6335)
author Bram Moolenaar <Bram@vim.org>
date Thu, 25 Jun 2020 20:00:54 +0200
parents 9dccf57e918a
children 2b07e2e7d95b
comparison
equal deleted inserted replaced
21007:dc8f29bb3272 21008:2cf49849e933
137 \ 'diff': ['file.diff', 'file.rej'], 137 \ 'diff': ['file.diff', 'file.rej'],
138 \ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS'], 138 \ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS'],
139 \ 'dnsmasq': ['/etc/dnsmasq.conf'], 139 \ 'dnsmasq': ['/etc/dnsmasq.conf'],
140 \ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'], 140 \ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'],
141 \ 'dosbatch': ['file.bat', 'file.sys'], 141 \ 'dosbatch': ['file.bat', 'file.sys'],
142 \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'], 142 \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini'],
143 \ 'dot': ['file.dot', 'file.gv'], 143 \ 'dot': ['file.dot', 'file.gv'],
144 \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'], 144 \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe'],
145 \ 'dsl': ['file.dsl'], 145 \ 'dsl': ['file.dsl'],
146 \ 'dtd': ['file.dtd'], 146 \ 'dtd': ['file.dtd'],
147 \ 'dts': ['file.dts', 'file.dtsi'], 147 \ 'dts': ['file.dts', 'file.dtsi'],
663 call assert_equal(['filetype detection:ON plugin:OFF indent:OFF'], 663 call assert_equal(['filetype detection:ON plugin:OFF indent:OFF'],
664 \ execute('filetype')->split("\n")) 664 \ execute('filetype')->split("\n"))
665 close 665 close
666 endfunc 666 endfunc
667 667
668 func Test_hook_file()
669 filetype on
670
671 call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
672 split Xfile.hook
673 call assert_equal('dosini', &filetype)
674 bwipe!
675
676 call writefile(['not pacman'], 'Xfile.hook')
677 split Xfile.hook
678 call assert_notequal('dosini', &filetype)
679 bwipe!
680
681 call delete('Xfile.hook')
682 filetype off
683 endfunc
684
685
668 " vim: shiftwidth=2 sts=2 expandtab 686 " vim: shiftwidth=2 sts=2 expandtab