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 /runtime/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 'runtime/filetype.vim')
-rw-r--r-- | runtime/filetype.vim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6d636ab8fe..7dca0e0d32 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1763,8 +1763,13 @@ au BufNewFile,BufReadPost *.tsscl setf tsscl " TWIG files au BufNewFile,BufReadPost *.twig setf twig -" Typescript -au BufNewFile,BufReadPost *.ts setf typescript +" Typescript or Qt translation file (which is XML) +au BufNewFile,BufReadPost *.ts + \ if getline(1) =~ '<?xml' | + \ setf xml | + \ else | + \ setf typescript | + \ endif " TypeScript with React au BufNewFile,BufRead *.tsx setf typescriptreact |