patch 9.1.0366: filetype: ondir files are not recognized

Commit: 
https://github.com/vim/vim/commit/ea999037a41292b3d3e00700a87a82fe5d2c12b2
Author: Jon Parise <j...@indelible.org>
Date:   Mon Apr 22 21:07:41 2024 +0200

    patch 9.1.0366: filetype: ondir files are not recognized
    
    Problem:  filetype: ondir files are not recognized
    Solution: Detect '.ondirrc' as ondir filetype
              (Jon Parise)
    
    closes: #14604
    
    Signed-off-by: Jon Parise <j...@indelible.org>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 8c7c015ef..9d6b4bd26 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1593,6 +1593,9 @@ au BufNewFile,BufRead *.odin                      setf 
odin
 " Omnimark
 au BufNewFile,BufRead *.xom,*.xin              setf omnimark
 
+" ondir
+au BufNewFile,BufRead .ondirrc                 setf ondir
+
 " OPAM
 au BufNewFile,BufRead opam,*.opam,*.opam.template setf opam
 
diff --git a/runtime/ftplugin/ondir.vim b/runtime/ftplugin/ondir.vim
new file mode 100644
index 000000000..0854578c9
--- /dev/null
+++ b/runtime/ftplugin/ondir.vim
@@ -0,0 +1,18 @@
+" Vim filetype plugin file
+" Language:     ondir <https://github.com/alecthomas/ondir>
+" Maintainer:   Jon Parise <j...@indelible.org>
+
+if exists('b:did_ftplugin')
+  finish
+endif
+
+let s:cpo_save = &cpoptions
+
+setlocal comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl comments< commentstring<'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
+
+" vim: et ts=4 sw=2 sts=2:
diff --git a/runtime/syntax/ondir.vim b/runtime/syntax/ondir.vim
new file mode 100644
index 000000000..4aeb014e1
--- /dev/null
+++ b/runtime/syntax/ondir.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language:     ondir <https://github.com/alecthomas/ondir>
+" Maintainer:   Jon Parise <j...@indelible.org>
+
+if exists('b:current_syntax')
+  finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+syn case match
+
+syn match   ondirComment  "#.*" contains=@Spell
+syn keyword ondirKeyword  final contained skipwhite nextgroup=ondirKeyword
+syn keyword ondirKeyword  enter leave contained skipwhite nextgroup=ondirPath
+syn match   ondirPath     "[^:]\+" contained display
+syn match   ondirColon    ":" contained display
+
+syn include @ondirShell   syntax/sh.vim
+syn region  ondirContent  start="^\s\+" end="^\ze\S.*$" keepend contained 
contains=@ondirShell
+
+syn region  ondirSection  start="^\(final\|enter\|leave\)" end="^\ze\S.*$" 
fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent
+
+hi def link ondirComment  Comment
+hi def link ondirKeyword  Keyword
+hi def link ondirPath     Special
+hi def link ondirColon    Operator
+
+let b:current_syntax = 'ondir'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
+
+" vim: et ts=4 sw=2 sts=2:
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 1d9954d1e..f8fe9ec5a 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -518,6 +518,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     octave: ['octaverc', '.octaverc', 'octave.conf', 
'any/.local/share/octave/history'],
     odin: ['file.odin'],
     omnimark: ['file.xom', 'file.xin'],
+    ondir: ['.ondirrc'],
     opam: ['opam', 'file.opam', 'file.opam.template'],
     openroad: ['file.or'],
     openscad: ['file.scad'],
diff --git a/src/version.c b/src/version.c
index a863838db..7113699f3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    366,
 /**/
     365,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1ryz89-008owV-Gf%40256bit.org.

Raspunde prin e-mail lui