Mercurial > vim
changeset 35548:587fc62ef49e v9.1.0532
patch 9.1.0532: filetype: Cedar files not recognized
Commit: https://github.com/vim/vim/commit/15addb24dd3b2645f5c04d2742ab5eb53444a3a0
Author: Riley Bruins <ribru17@hotmail.com>
Date: Fri Jul 5 21:14:26 2024 +0200
patch 9.1.0532: filetype: Cedar files not recognized
Problem: filetype: Cedar files not recognized
Solution: Detect '*.cedar' files as cedar filetype
(Riley Bruins)
References: https://github.com/cedar-policy
closes: #15148
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Jul 2024 21:30:03 +0200 |
parents | 8089e65941fd |
children | 307cb6ce5fa3 |
files | .github/MAINTAINERS runtime/filetype.vim runtime/ftplugin/cedar.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 5 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -113,6 +113,7 @@ runtime/ftplugin/astro.vim @romainl runtime/ftplugin/awk.vim @dkearns runtime/ftplugin/basic.vim @dkearns runtime/ftplugin/bst.vim @tpope +runtime/ftplugin/cedar.vim @ribru17 runtime/ftplugin/cfg.vim @chrisbra runtime/ftplugin/chatito.vim @ObserverOfTime runtime/ftplugin/chicken.vim @evhan
--- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -321,6 +321,9 @@ au BufNewFile,BufRead *.toc " Cdrdao config au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf +" Cedar +au BufNewFile,BufRead *.cedar setf cedar + " Cfengine au BufNewFile,BufRead cfengine.conf setf cfengine
new file mode 100644 --- /dev/null +++ b/runtime/ftplugin/cedar.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Cedar +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 4 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:// commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<'
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -142,6 +142,7 @@ def s:GetFilenameChecks(): dict<list<str cdl: ['file.cdl'], cdrdaoconf: ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao', 'any/etc/cdrdao.conf', 'any/etc/default/cdrdao', 'any/etc/defaults/cdrdao'], cdrtoc: ['file.toc'], + cedar: ['file.cedar'], cf: ['file.cfm', 'file.cfi', 'file.cfc'], cfengine: ['cfengine.conf'], cfg: ['file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'],