1
0
forked from aniani/vim

patch 9.0.0771: cannot always tell the difference beween tex and rexx files

Problem:    Cannot always tell the difference beween tex and rexx files.
Solution:   Recognize tex by a leading backslash. (Martin Tournoij,
            closes #11380)
This commit is contained in:
Martin Tournoij 2022-10-16 12:49:12 +01:00 committed by Bram Moolenaar
parent d8cd6f7427
commit bd053f894b
3 changed files with 8 additions and 1 deletions

View File

@ -145,7 +145,7 @@ export def FTcls()
return
endif
if getline(1) =~ '^%'
if getline(1) =~ '^\v%(\%|\\)'
setf tex
elseif getline(1)[0] == '#' && getline(1) =~ 'rexx'
setf rexx

View File

@ -1741,6 +1741,11 @@ func Test_cls_file()
call assert_equal('tex', &filetype)
bwipe!
call writefile(['\NeedsTeXFormat{LaTeX2e}'], 'Xfile.cls')
split Xfile.cls
call assert_equal('tex', &filetype)
bwipe!
" Rexx
call writefile(['# rexx'], 'Xfile.cls')

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
771,
/**/
770,
/**/