diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-10-23 19:32:42 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-10-24 10:15:47 +0200 |
commit | 0b1ec3b162cb160da9b876113ec219a8bac17f70 (patch) | |
tree | 14c5711f4ed7b486306229f04f388ed7105fbeeb | |
parent | 4f0adb6a783e2d92301d5391c4b35a62268d2a00 (diff) | |
download | rneovim-0b1ec3b162cb160da9b876113ec219a8bac17f70.tar.gz rneovim-0b1ec3b162cb160da9b876113ec219a8bac17f70.tar.bz2 rneovim-0b1ec3b162cb160da9b876113ec219a8bac17f70.zip |
vim-patch:9.0.2063: pacman hooks are detected as conf filetype
Problem: pacman hooks are detected as conf filetype
Solution: make it consistent to pacman.conf and detect those
hooks as confini
Because confini has much better syntax highlighting than conf.
For reference, I identified pacman.conf and pacman hooks as dosini in
https://github.com/vim/vim/pull/6335, then
https://github.com/vim/vim/pull/10213 changed them to conf, then
https://github.com/vim/vim/pull/10518 changed pacman.conf to confini but
forgot to change hooks.
closes: vim/vim#13399
https://github.com/vim/vim/commit/7d254dbc2db35badc65668db85f826f605486986
Co-authored-by: Guido Cella <guido@guidocella.xyz>
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 3c3e2a7b5b..627732f164 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -282,7 +282,7 @@ local extension = { atg = 'coco', recipe = 'conaryrecipe', hook = function(path, bufnr) - return M._getline(bufnr, 1) == '[Trigger]' and 'conf' or nil + return M._getline(bufnr, 1) == '[Trigger]' and 'confini' or nil end, nmconnection = 'confini', mklx = 'context', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 1c449aa93e..3d2fd878ee 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -1388,12 +1388,12 @@ func Test_hook_file() call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook', 'D') split Xfile.hook - call assert_equal('conf', &filetype) + call assert_equal('confini', &filetype) bwipe! call writefile(['not pacman'], 'Xfile.hook') split Xfile.hook - call assert_notequal('conf', &filetype) + call assert_notequal('confini', &filetype) bwipe! filetype off |