patch 9.0.1820: Rexx files may not be recognised
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>
This commit is contained in:
committed by
Christian Brabandt
parent
3e1e63de18
commit
e06afb7860
14
runtime/autoload/dist/ft.vim
vendored
14
runtime/autoload/dist/ft.vim
vendored
@ -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
|
||||
|
||||
4
runtime/autoload/dist/script.vim
vendored
4
runtime/autoload/dist/script.vim
vendored
@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user