From ca731d2e55f830d98075a14fb74b494598c70c74 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 3 Jan 2026 09:44:56 +0800 Subject: [PATCH] vim-patch:9.1.2042: filetype: systemd quadlet files are not recognized (#37208) Problem: filetype: systemd quadlet files are not recognized Solution: Detect additional patterns as systemd filetype (Ac5000) Reference: - https://docs.podman.io/en/latest/markdown/podman.1.html - https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html - https://docs.podman.io/en/latest/markdown/podman-quadlet.1.html fixes: vim/vim#15078 closes: vim/vim#19057 https://github.com/vim/vim/commit/0f93c988e97325bfc54654bc2cf4178fb11ba865 Co-authored-by: Ac5000 <15003210+Ac5000@users.noreply.github.com> --- runtime/lua/vim/filetype.lua | 27 +++++++++++++++++++++++++++ test/old/testdir/test_filetype.vim | 29 ++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 986dd9f248..f304eea23f 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2107,6 +2107,24 @@ local pattern = { ['/etc/systemd/system/.*%.d/.*%.conf$'] = 'systemd', ['/etc/systemd/system/.*%.d/%.#'] = 'systemd', ['/etc/systemd/system/%.#'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.artifact$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.build$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.container$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.image$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.kube$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.network$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.pod$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.volume$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.artifact$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.build$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.container$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.image$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.kube$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.network$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.pod$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.volume$'] = 'systemd', + ['/etc/containers/systemd/users/.*/.*%.d/.*%.conf$'] = 'systemd', + ['/etc/containers/systemd/users/.*%.d/.*%.conf$'] = 'systemd', ['/etc/config/'] = starsetf(detect.uci), ['/etc/udev/udev%.conf$'] = 'udevconf', ['/etc/udev/permissions%.d/.*%.permissions$'] = 'udevperm', @@ -2357,6 +2375,14 @@ local pattern = { ['/%.config/systemd/user/%.#'] = 'systemd', ['/%.config/systemd/user/.*%.d/%.#'] = 'systemd', ['/%.config/systemd/user/.*%.d/.*%.conf$'] = 'systemd', + ['/containers/systemd/.*%.artifact$'] = 'systemd', + ['/containers/systemd/.*%.build$'] = 'systemd', + ['/containers/systemd/.*%.container$'] = 'systemd', + ['/containers/systemd/.*%.image$'] = 'systemd', + ['/containers/systemd/.*%.kube$'] = 'systemd', + ['/containers/systemd/.*%.network$'] = 'systemd', + ['/containers/systemd/.*%.pod$'] = 'systemd', + ['/containers/systemd/.*%.volume$'] = 'systemd', ['/systemd/.*%.automount$'] = 'systemd', ['/systemd/.*%.dnssd$'] = 'systemd', ['/systemd/.*%.link$'] = 'systemd', @@ -2495,6 +2521,7 @@ local pattern = { ['/pipewire/.*%.conf$'] = 'spajson', ['/wireplumber/.*%.conf$'] = 'spajson', ['/%.ssh/.*%.conf$'] = 'sshconfig', + ['/containers/systemd/.*%.d/.*%.conf$'] = 'systemd', ['^%.?tmux.*%.conf$'] = 'tmux', ['^%.?tmux.*%.conf'] = starsetf('tmux'), ['/containers/containers%.conf$'] = 'toml', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 7676a806ec..b7333a2892 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -829,7 +829,34 @@ func s:GetFilenameChecks() abort \ 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file', \ 'any/etc/systemd/system/file.d/.#', \ 'any/etc/systemd/system/file.d/.#-file', - \ 'any/etc/systemd/system/file.d/file.conf'], + \ 'any/etc/systemd/system/file.d/file.conf', + \ 'any/containers/systemd/file.artifact', + \ 'any/containers/systemd/file.build', + \ 'any/containers/systemd/file.container', + \ 'any/containers/systemd/file.image', + \ 'any/containers/systemd/file.kube', + \ 'any/containers/systemd/file.network', + \ 'any/containers/systemd/file.pod', + \ 'any/containers/systemd/file.volume', + \ 'any/containers/systemd/users/any/file.artifact', + \ 'any/containers/systemd/users/any/file.build', + \ 'any/containers/systemd/users/any/file.container', + \ 'any/containers/systemd/users/any/file.image', + \ 'any/containers/systemd/users/any/file.kube', + \ 'any/containers/systemd/users/any/file.network', + \ 'any/containers/systemd/users/any/file.pod', + \ 'any/containers/systemd/users/any/file.volume', + \ 'any/containers/systemd/users/file.artifact', + \ 'any/containers/systemd/users/file.build', + \ 'any/containers/systemd/users/file.container', + \ 'any/containers/systemd/users/file.image', + \ 'any/containers/systemd/users/file.kube', + \ 'any/containers/systemd/users/file.network', + \ 'any/containers/systemd/users/file.pod', + \ 'any/containers/systemd/users/file.volume', + \ 'any/containers/systemd/some.d/file.conf', + \ 'etc/containers/systemd/users/1111/some.d/file.conf', + \ 'etc/containers/systemd/users/some.d/file.conf'], \ 'systemverilog': ['file.sv', 'file.svh'], \ 'tablegen': ['file.td'], \ 'tags': ['tags'],