patch 9.2.0025: filetype: cshtml incorrectly recognized
Commit:
https://github.com/vim/vim/commit/68dbb58d5189d1293b0f8e032af6bcb84101bd86
Author: tris203 <
ad...@snappeh.com>
Date: Wed Feb 18 22:00:09 2026 +0000
patch 9.2.0025: filetype: cshtml incorrectly recognized
Problem: filetype: cshtml incorrectly recognized, razor files are not
recognized
Solution: Detect *.cshtml and *.razor files as razor filetype
(tris203)
Reference:
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-10.0
closes: #19207
Signed-off-by: tris203 <
ad...@snappeh.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 32f8fb6e2..d5bd636bd 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: The Vim Project <
https://github.com/vim/vim>
-# Last Change: 2026 Feb 06
+# Last Change: 2026 Feb 18
# Former Maintainer: Bram Moolenaar <
Br...@vim.org>
# These functions are moved here from runtime/filetype.vim to make startup
@@ -2571,6 +2571,9 @@ const ft_from_ext = {
"rakumod": "raku",
"rakudoc": "raku",
"rakutest": "raku",
+ # Razor
+ "cshtml": "razor",
+ "razor": "razor",
# Renderman Interface Bytestream
"rib": "rib",
# Rego Policy Language
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index bfdf46e1a..470325d13 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <
https://github.com/vim/vim>
-" Last Change: 2026 Jan 20
+" Last Change: 2026 Feb 18
" Former Maintainer: Bram Moolenaar <
Br...@vim.org>
" If the filetype can be detected from extension or file name(the final path component),
@@ -535,7 +535,6 @@ au BufNewFile,BufRead init.trans,*/etc/translate-shell,.trans setf clojure
" HTML (.stm for server side, .shtml is server-side or superhtml)
au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml()
-au BufNewFile,BufRead *.cshtml setf html
" Host config
au BufNewFile,BufRead */etc/host.conf setf hostconf
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 8b59a3645..82caa2baf 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -379,7 +379,7 @@ def s:GetFilenameChecks(): dict<list<string>>
hostconf: ['/etc/host.conf', 'any/etc/host.conf'],
hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'],
# file.component.html should be HTML, not Angular, see #13594
- html: ['file.html', 'file.htm', 'file.cshtml', 'file.component.html'],
+ html: ['file.html', 'file.htm', 'file.component.html'],
htmlm4: ['file.html.m4'],
httest: ['file.htt', 'file.htb'],
http: ['file.http'],
@@ -680,6 +680,7 @@ def s:GetFilenameChecks(): dict<list<string>>
rapid: ['file.sysx', 'file.Sysx', 'file.SysX', 'file.SYSx', 'file.SYSX', 'file.modx', 'file.Modx', 'file.ModX', 'file.MODx', 'file.MODX'],
rasi: ['file.rasi', 'file.rasinc'],
ratpoison: ['.ratpoisonrc', 'ratpoisonrc'],
+ razor: ['file.cshtml', 'file.razor'],
rbs: ['file.rbs'],
rc: ['file.rc', 'file.rch'],
rcs: ['file,v'],
diff --git a/src/version.c b/src/version.c
index 6618340d7..fa0ca1f30 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 */
+/**/
+ 25,
/**/
24,
/**/