diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-03 18:56:13 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-03 18:58:30 -0500 |
commit | 2bcae2024230eb4dd1013779ec1b69dc104c4021 (patch) | |
tree | a4c65c0b3e257b75e0a0bfeee1f65b3296b580a4 /runtime/filetype.vim | |
parent | f85386d170892bceecb6923f68f8861a84a77b9d (diff) | |
download | rneovim-2bcae2024230eb4dd1013779ec1b69dc104c4021.tar.gz rneovim-2bcae2024230eb4dd1013779ec1b69dc104c4021.tar.bz2 rneovim-2bcae2024230eb4dd1013779ec1b69dc104c4021.zip |
vim-patch:8.2.2085: Qt translation file is recognized as typescript
Problem: Qt translation file is recognized as typescript.
Solution: Check the first line for "<?xml". (closes vim/vim#7418)
https://github.com/vim/vim/commit/c0d670ce16d0e148b7d39ac354571b3d284a0b53
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 b9d2a43d5d..ed19fa1a43 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1768,8 +1768,13 @@ au BufNewFile,BufReadPost *.tutor setf tutor " 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 |