summaryrefslogtreecommitdiffstats
path: root/runtime/autoload
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2023-08-29 22:21:35 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-29 22:21:35 +0200
commite06afb7860805537ccd69966bc03169852c9b378 (patch)
tree9dcd1f105f8a80e38a3355a695f9e9d8da0106e3 /runtime/autoload
parent3e1e63de185712a6afa7b4acf4488a5dbcbe5e5f (diff)
patch 9.0.1820: Rexx files may not be recognisedv9.0.1820
Problem: Rexx files may not be recognised Solution: Add shebang detection and improve disambiguation of *.cls files closes: #12951 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/dist/ft.vim14
-rw-r--r--runtime/autoload/dist/script.vim4
2 files changed, 14 insertions, 4 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 6c15c29b53..2958f45d0a 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -147,13 +147,19 @@ export def FTcls()
endif
var line1 = getline(1)
-
- if line1 =~ '^\v%(\%|\\)'
- setf tex
- elseif line1[0] == '#' && line1 =~ 'rexx'
+ if line1 =~ '^#!.*\<\%(rexx\|regina\)\>'
setf rexx
+ return
elseif line1 == 'VERSION 1.0 CLASS'
setf vb
+ return
+ endif
+
+ var nonblank1 = getline(nextnonblank(1))
+ if nonblank1 =~ '^\v%(\%|\\)'
+ setf tex
+ elseif nonblank1 =~ '^\s*\%(/\*\|::\w\)'
+ setf rexx
else
setf st
endif
diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
index 6163003aa4..fca5dcdbe6 100644
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -213,6 +213,10 @@ export def Exe2filetype(name: string, line1: string): string
elseif name =~ '^crystal\>'
return 'crystal'
+ # Rexx
+ elseif name =~ '^\%(rexx\|regina\)\>'
+ return 'rexx'
+
endif
return ''