patch 9.2.0557: filetype: Kawasaki Robots files are not recognized
Commit:
https://github.com/vim/vim/commit/dec3d6c7da637de5717c27d24a2f7ca50f7180a3
Author: KnoP-01 <[email protected]>
Date: Fri May 29 17:46:36 2026 +0000
patch 9.2.0557: filetype: Kawasaki Robots files are not recognized
Problem: filetype: Kawasaki Robots files are not recognized
Solution: Detect *.pg as kawasaki_as filetype, add filetype detection
for *.as as atlas or kawasaki_as filetype (KnoP-01).
In Kawasaki robots (https://kawasakirobotics.com/products-robots/)
AS language
*.pg is the extention for a program file and
*.as is for a complete backup.
closes: #20370
Signed-off-by: KnoP-01 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 3b585b61d..9419cf58a 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 May 28
+# Last Change: 2026 May 29
# Former Maintainer: Bram Moolenaar <[email protected]>
# These functions are moved here from runtime/filetype.vim to make startup
@@ -63,6 +63,21 @@ export def FTapp()
endfor
enddef
+# This function checks for Kawasaki robots AS file or atlas file type.
+export def FTas()
+ if exists("g:filetype_as")
+ exe "setf " .. g:filetype_as
+ return
+ endif
+ for lnum in range(1, min([line("$"), 30]))
+ if getline(lnum) =~ '^\.NETCONF'
+ setf kawasaki_as
+ return
+ endif
+ endfor
+ setf atlas
+enddef
+
# This function checks for the kind of assembly that is wanted by the user, or
# can be detected from the beginning of the file.
export def FTasm()
@@ -1771,7 +1786,6 @@ const ft_from_ext = {
"astro": "astro",
# Atlas
"atl": "atlas",
- "as": "atlas",
# Atom is based on XML
"atom": "xml",
# Authzed
@@ -2300,6 +2314,8 @@ const ft_from_ext = {
# KAREL
"kl": "karel",
"KL": "karel",
+ # Kawasaki AS
+ "pg": "kawasaki_as",
# KDL
"kdl": "kdl",
# KerML
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 5078913e6..80c3bb810 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -1,4 +1,4 @@
-*filetype.txt* For Vim version 9.2. Last change: 2026 May 16
+*filetype.txt* For Vim version 9.2. Last change: 2026 May 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -139,6 +139,7 @@ variables can be used to overrule the filetype used for
certain extensions:
file name variable ~
*.app g:filetype_app
+ *.as g:filetype_as
*.asa g:filetype_asa |ft-aspperl-syntax|
|ft-aspvbs-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index da632acc5..3590ebe97 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 Apr 20
+" Last Change: 2026 May 29
" Former Maintainer: Bram Moolenaar <[email protected]>
" If the filetype can be detected from extension or file name(the final path
component),
@@ -91,6 +91,9 @@ au BufNewFile,BufRead */.aptitude/config setf aptconf
" Arch Inventory file
au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
+" atlas or kawasaki_as
+au BufNewFile,BufRead *.as call dist#ft#FTas()
+
" Active Server Pages (with Visual Basic Script)
au BufNewFile,BufRead *.asa
\ if exists("g:filetype_asa") |
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index aefdef1b5..5eb08f277 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -434,6 +434,7 @@ def s:GetFilenameChecks(): dict<list<string>>
julia: ['file.jl'],
just: ['justfile', 'Justfile', '.justfile', 'config.just'],
karel: ['file.kl', 'file.KL'],
+ kawasaki_as: ['file.pg'],
kconfig: ['Kconfig', 'Kconfig.debug', 'Kconfig.file', 'Config.in',
'Config.in.host'],
kdl: ['file.kdl'],
kerml: ['file.kerml'],
@@ -3540,4 +3541,19 @@ func Test_cucumber_code_injection()
filetype plugin off
endfunc
+func Test_as_file()
+ filetype on
+
+ call writefile([], 'Xfile.as', 'D')
+ split Xfile.as
+ call assert_equal('atlas', &filetype)
+ bwipe!
+ call writefile(['', '.NETCONF'], 'Xfile.as', 'D')
+ split Xfile.as
+ call assert_equal('kawasaki_as', &filetype)
+ bwipe!
+
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index d17b4d586..685887351 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 557,
/**/
556,
/**/
--
--
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/E1wT1V6-00D1qC-EY%40256bit.org.