]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0897: filetype: pyrex files are not detected v9.1.0897
authoruser202729 <25191436+user202729@users.noreply.github.com>
Sat, 30 Nov 2024 10:09:49 +0000 (11:09 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 30 Nov 2024 10:09:49 +0000 (11:09 +0100)
Problem:  filetype: pyrex files are not detected
Solution: detect '*.pxi' and '*.pyx+' as pyrex filetype
          (user202729)

References:
https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types
https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/using_with_c++.html

closes: #16136

Signed-off-by: user202729 <25191436+user202729@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 08290d0b8723d8331425e8cc8a8bb083289c6fff..f91d405f7dc263b943526a8fa433aca40a450319 100644 (file)
@@ -1982,8 +1982,8 @@ au BufNewFile,BufRead MANIFEST.in         setf pymanifest
 " Pyret
 au BufNewFile,BufRead *.arr                    setf pyret
 
-" Pyrex
-au BufNewFile,BufRead *.pyx,*.pxd              setf pyrex
+" Pyrex/Cython
+au BufNewFile,BufRead *.pyx,*.pyx+,*.pxd,*.pxi setf pyrex
 
 " Python, Python Shell Startup and Python Stub Files
 " Quixote (Python-based web framework)
index 4a905a889a1a0074ab4a4cd3f35073c442937357..51f4dc1c898067fbe0eb328781c04d33045b6fbb 100644 (file)
@@ -613,7 +613,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     purescript: ['file.purs'],
     pymanifest: ['MANIFEST.in'],
     pyret: ['file.arr'],
-    pyrex: ['file.pyx', 'file.pxd'],
+    pyrex: ['file.pyx', 'file.pxd', 'file.pxi', 'file.pyx+'],
     python: ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', '.python_history', '.jline-jython.history', 'file.ptl', 'file.pyi', 'SConstruct'],
     ql: ['file.ql', 'file.qll'],
     qml: ['file.qml', 'file.qbs'],
index e1f8489cb50fcc67d90953598e9355f00fb3225b..e3093a3db01c143d0129f3991d7cb14e1cb25176 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    897,
 /**/
     896,
 /**/