mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 00:46:30 +00:00
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)
c0d670ce16
This commit is contained in:
@@ -471,7 +471,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'],
|
||||
@@ -668,5 +667,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
|
||||
|
Reference in New Issue
Block a user