From bd053f894b0d7652928201faa68c53d1ce2acdc5 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Sun, 16 Oct 2022 12:49:12 +0100 Subject: [PATCH] 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) --- runtime/autoload/dist/ft.vim | 2 +- src/testdir/test_filetype.vim | 5 +++++ src/version.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 48eaf3f60..d5c21ac18 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -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 diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 0fb73b7df..281642ee9 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -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') diff --git a/src/version.c b/src/version.c index e9cacd59c..1fc011ffb 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 771, /**/ 770, /**/ -- 2.40.0