patch 9.2.0327: filetype: uv scripts are not detected

Commit: 
https://github.com/vim/vim/commit/6c16ccaf6101a5a4fa28df9ca31e0bf871541aa4
Author: Christian Brabandt <[email protected]>
Date:   Thu Apr 9 20:50:01 2026 +0000

    patch 9.2.0327: filetype: uv scripts are not detected
    
    Problem:  filetype: uv scripts are not detected
              (Asger Hautop Drewsen)
    Solution: Detect uv scripts as python filetype if the shebang line
              contains "uv run"
    
    Reference:
    
https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file
    
    fixes: #19941
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
index de168f0c0..0106900f8 100644
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -4,7 +4,7 @@ vim9script
 # Invoked from "scripts.vim" in 'runtimepath'
 #
 # Maintainer:  The Vim Project <https://github.com/vim/vim>
-# Last Change: 2025 Dec 22
+# Last Change: 2026 Apr 09
 # Former Maintainer:   Bram Moolenaar <[email protected]>
 
 export def DetectFiletype()
@@ -115,7 +115,7 @@ export def Exe2filetype(name: string, line1: string): string
     return 'php'
 
     # Python
-  elseif name =~ 'python'
+  elseif name =~ 'python' || (name == 'uv' && line1 =~ '\<uv run\>')
     return 'python'
 
     # Groovy
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 7a6615531..04036b0eb 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -1108,7 +1108,8 @@ def s:GetScriptChecks(): dict<list<list<string>>>
     php:    [['#!/path/php']],
     python: [['#!/path/python'],
             ['#!/path/python2'],
-            ['#!/path/python3']],
+            ['#!/path/python3'],
+            ['#!/usr/bin/env -S uv run --script']],
     groovy: [['#!/path/groovy']],
     ruby:   [['#!/path/ruby']],
     javascript: [['#!/path/node'],
diff --git a/src/version.c b/src/version.c
index 70bca3689..483f55d9f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    327,
 /**/
     326,
 /**/

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wAwTr-00CDEv-9C%40256bit.org.

Raspunde prin e-mail lui