From 4ca699c85b178c90dc5261d3a6dc5bbee2631776 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 15 Feb 2024 00:10:53 +0100 Subject: [PATCH] vim-patch:9.1.0110: filetype: add 'Config.in' filetype detection The 'Config.in' file type is for Buildroot configuration files. Buildroot Config.in files use the same Kconfig backend as the Linux kernel's Kconfig files. Buildroot also has other filename variants that follow "Config.in.*", they are used to distinguish multiple Config.in files in the same directory. See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file closes: vim/vim#14038 https://github.com/vim/vim/commit/5f20f050efed3431beaf85739f0113e9ef0abd8e Co-authored-by: Brandon Maier --- runtime/lua/vim/filetype.lua | 2 ++ test/old/testdir/test_filetype.vim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 65f07f02d1221d..518ef13e6feb41 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1348,6 +1348,7 @@ local filename = { ['.justfile'] = 'just', Kconfig = 'kconfig', ['Kconfig.debug'] = 'kconfig', + ['Config.in'] = 'kconfig', ['lftp.conf'] = 'lftp', ['.lftprc'] = 'lftp', ['/.libao'] = 'libao', @@ -1739,6 +1740,7 @@ local pattern = { ['[jt]sconfig.*%.json'] = 'jsonc', ['[jJ]ustfile'] = 'just', ['Kconfig%..*'] = starsetf('kconfig'), + ['Config%.in%..*'] = starsetf('kconfig'), ['.*%.[Ss][Uu][Bb]'] = 'krl', ['lilo%.conf.*'] = starsetf('lilo'), ['.*/etc/logcheck/.*%.d.*/.*'] = starsetf('logcheck'), diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 13cd1e5cb5c9c2..2612a928782f2e 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -347,7 +347,7 @@ func s:GetFilenameChecks() abort \ 'jsp': ['file.jsp'], \ 'julia': ['file.jl'], \ 'just': ['justfile', 'Justfile', '.justfile', 'config.just'], - \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'], + \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file', 'Config.in', 'Config.in.host'], \ 'kdl': ['file.kdl'], \ 'kivy': ['file.kv'], \ 'kix': ['file.kix'],