aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-07-05 21:39:51 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-07-06 11:05:19 +0200
commit0abaccb2a795c40cd7f55b9a19fe6ecb765479e2 (patch)
tree0bb18425fc1a248348f0a6c2f22d81b46c7c4667
parent3c53e8f78511d6db9a6c804e5a479ba38c33102d (diff)
downloadrneovim-0abaccb2a795c40cd7f55b9a19fe6ecb765479e2.tar.gz
rneovim-0abaccb2a795c40cd7f55b9a19fe6ecb765479e2.tar.bz2
rneovim-0abaccb2a795c40cd7f55b9a19fe6ecb765479e2.zip
vim-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: vim/vim#15148 https://github.com/vim/vim/commit/15addb24dd3b2645f5c04d2742ab5eb53444a3a0 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
-rw-r--r--runtime/ftplugin/cedar.vim13
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--test/old/testdir/test_filetype.vim1
3 files changed, 15 insertions, 0 deletions
diff --git a/runtime/ftplugin/cedar.vim b/runtime/ftplugin/cedar.vim
new file mode 100644
index 0000000000..74a1903b46
--- /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<'
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 6d3fc48efc..d2cf87bea5 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -261,6 +261,7 @@ local extension = {
cdc = 'cdc',
cdl = 'cdl',
toc = detect_line1('\\contentsline', 'tex', 'cdrtoc'),
+ cedar = 'cedar',
cfc = 'cf',
cfm = 'cf',
cfi = 'cf',
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index da312ded8a..5675068c71 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -143,6 +143,7 @@ func s:GetFilenameChecks() abort
\ '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'],