diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-25 20:49:48 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-07-04 10:05:34 -0400 |
commit | 43a2e5fe4b4e107a53ccd5edbf2f3c0a97d79f6e (patch) | |
tree | b37d93e712a62973d1f0b1c63c5f53980f02627c /src | |
parent | bd5f0e9695cb21c8b97f844ce21432ee8d06b7ed (diff) | |
download | rneovim-43a2e5fe4b4e107a53ccd5edbf2f3c0a97d79f6e.tar.gz rneovim-43a2e5fe4b4e107a53ccd5edbf2f3c0a97d79f6e.tar.bz2 rneovim-43a2e5fe4b4e107a53ccd5edbf2f3c0a97d79f6e.zip |
vim-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 vim/vim#6335)
https://github.com/vim/vim/commit/73b4465ba7f170c5a1701ad908144970e758b1f5
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 9303fac927..d0dcdeaebb 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -139,7 +139,7 @@ let s:filename_checks = { \ 'dnsmasq': ['/etc/dnsmasq.conf'], \ 'dockerfile': ['Dockerfile', 'file.Dockerfile'], \ 'dosbatch': ['file.bat', 'file.sys'], - \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'], + \ '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'], @@ -639,3 +639,23 @@ func Test_setfiletype_completion() call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"setfiletype java javacc javascript javascriptreact', @:) 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 |