changeset 34813:207487eb4f4e v9.1.0279

patch 9.1.0279: filetype: roc files are not recognized Commit: https://github.com/vim/vim/commit/196b6678c5483217ea5bc7d047b02c915615dae6 Author: nat-418 <93013864+nat-418@users.noreply.github.com> Date: Mon Apr 8 22:23:22 2024 +0200 patch 9.1.0279: filetype: roc files are not recognized Problem: filetype: roc files are not recognized Solution: Detect '*.roc' files as roc filetype, add a basic filetype plugin (nat-418) closes: #14416 Signed-off-by: nat-418 <93013864+nat-418@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 08 Apr 2024 22:30:06 +0200
parents abd700c1a959
children 6ff5ddfde885
files runtime/filetype.vim runtime/ftplugin/roc.vim src/testdir/test_filetype.vim src/version.c
diffstat 4 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1888,6 +1888,9 @@ au BufNewFile,BufRead *.robot,*.resource
 " Robots.txt
 au BufNewFile,BufRead robots.txt		setf robots
 
+" Roc
+au BufNewFile,BufRead *.roc			setf roc
+
 " RON (Rusty Object Notation)
 au BufNewFile,BufRead *.ron			setf ron
 
new file mode 100644
--- /dev/null
+++ b/runtime/ftplugin/roc.vim
@@ -0,0 +1,14 @@
+" Roc filetype plugin file
+" Language: Roc
+" Maintainer: nat-418 <93013864+nat-418@users.noreply.github.com>
+" Latest Revision: 2024-04-5
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal comments=:##,:#
+setlocal commentstring=#\ %s
+
+let b:undo_ftplugin = "setl com< cms<"
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -597,6 +597,7 @@ def s:GetFilenameChecks(): dict<list<str
     rpgle: ['file.rpgle', 'file.rpgleinc'],
     robot: ['file.robot', 'file.resource'],
     robots: ['robots.txt'],
+    roc: ['file.roc'],
     ron: ['file.ron'],
     routeros: ['file.rsc'],
     rpcgen: ['file.x'],
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    279,
+/**/
     278,
 /**/
     277,