]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1359: filetype: GNU Radio config files are not recognized v9.1.1359
authorzeertzjq <zeertzjq@outlook.com>
Fri, 2 May 2025 13:32:23 +0000 (15:32 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 2 May 2025 13:32:23 +0000 (15:32 +0200)
Problem:  filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype.  Only
          allow '#' as start of comment in confini syntax (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Files

closes: #17242

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
runtime/syntax/cfg.vim
runtime/syntax/confini.vim
src/testdir/test_filetype.vim
src/version.c

index 87eac418fb4cc95c4be9045c2360fca105e2c25d..209f0dc2e7a6188438725637ac997096907a495a 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Apr 24
+" Last Change: 2025 May 02
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " Listen very carefully, I will say this only once
@@ -1811,6 +1811,8 @@ au BufNewFile,BufRead pacman.conf,mpv.conf                setf confini
 au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini
 au BufNewFile,BufRead *.nmconnection                   setf confini
 au BufNewFile,BufRead paru.conf                                setf confini
+au BufNewFile,BufRead */{,.}gnuradio/*.conf            setf confini
+au BufNewFile,BufRead */gnuradio/conf.d/*.conf         setf confini
 
 " Pacman hooks
 au BufNewFile,BufRead *.hook
index 4b5ebf5c25cb94f64c9257386c24fa38d761cac1..69788760cc63af6fb9d87df3d43fc51e000f6a18 100644 (file)
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:    Good old CFG files
 " Maintainer:  Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
-" Last change: 2012 Aug 11
+" Last Change: 2012 Aug 11
 " 2024 Nov 14 by Vim project:  // only denotes a comment when starting a line (#16051)
 
 " quit when a syntax file was already loaded
index 823d417a819d7371740734fcc025a794eadb2caf..009a60c60a8c68f62adbe02596f6c8720f3f4cb6 100644 (file)
@@ -1,5 +1,7 @@
 " Vim syntax file
 " Language: confini
+" Last Change:
+" 2025 May 02 by Vim project commented line starts with # only
 
 " Quit if a syntax file was already loaded
 if exists("b:current_syntax")
@@ -9,4 +11,8 @@ endif
 " Use the cfg syntax for now, it's similar.
 runtime! syntax/cfg.vim
 
+" Only accept '#' as the start of a comment.
+syn clear CfgComment
+syn match CfgComment "#.*" contains=@Spell
+
 let b:current_syntax = 'confini'
index 260c3ee72b42ddac0d61c058ada9671f3246c1a5..bfafdbb3616b4c86de128a1d0949eb435d19e2a5 100644 (file)
@@ -183,7 +183,8 @@ def s:GetFilenameChecks(): dict<list<string>>
     conaryrecipe: ['file.recipe'],
     conf: ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags'],
     config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'],
-    confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
+    confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection',
+              'any/.gnuradio/grc.conf', 'any/gnuradio/config.conf', 'any/gnuradio/conf.d/modtool.conf'],
     context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
     cook: ['file.cook'],
     corn: ['file.corn'],
index 817398858df7b69693f12842e3ad9636450c857b..d64a1e6c54d7dc6ef635130537d601c7d5e02382 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1359,
 /**/
     1358,
 /**/