diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-12-03 21:08:37 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-12-03 21:08:37 +0100 |
commit | c0d670ce16d0e148b7d39ac354571b3d284a0b53 (patch) | |
tree | 7d714a047715e24242cb2cd72707bc7fcddf3e50 /src/testdir/test_filetype.vim | |
parent | 0684e36a7ee0743f2889698fb8e0e14f7acae423 (diff) |
patch 8.2.2085: Qt translation file is recognized as typescriptv8.2.2085
Problem: Qt translation file is recognized as typescript.
Solution: Check the first line for "<?xml". (closes #7418)
Diffstat (limited to 'src/testdir/test_filetype.vim')
-rw-r--r-- | src/testdir/test_filetype.vim | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 15ba59ae9f..93540829a5 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -487,7 +487,6 @@ let s:filename_checks = { \ 'tssgm': ['file.tssgm'], \ 'tssop': ['file.tssop'], \ 'twig': ['file.twig'], - \ 'typescript': ['file.ts'], \ 'typescriptreact': ['file.tsx'], \ 'uc': ['file.uc'], \ 'udevconf': ['/etc/udev/udev.conf', 'any/etc/udev/udev.conf'], @@ -709,5 +708,22 @@ func Test_hook_file() filetype off endfunc +func Test_ts_file() + filetype on + + call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts') + split Xfile.ts + call assert_equal('xml', &filetype) + bwipe! + + call writefile(['// looks like Typescript'], 'Xfile.ts') + split Xfile.ts + call assert_equal('typescript', &filetype) + bwipe! + + call delete('Xfile.hook') + filetype off +endfunc + " vim: shiftwidth=2 sts=2 expandtab |