mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:8.2.4274: Basic and form filetype detection is incomplete (#17259)
Problem: Basic and form filetype detection is incomplete.
Solution: Add a separate function for .frm files. (Doug Kearns, closes vim/vim#9675)
c570e9cf68
This commit is contained in:
@@ -183,6 +183,7 @@ let s:filename_checks = {
|
||||
\ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'],
|
||||
\ 'fish': ['file.fish'],
|
||||
\ 'focexec': ['file.fex', 'file.focexec'],
|
||||
\ 'form': ['file.frm'],
|
||||
\ 'forth': ['file.ft', 'file.fth'],
|
||||
\ 'fortran': ['file.f', 'file.for', 'file.fortran', 'file.fpp', 'file.ftn', 'file.f77', 'file.f90', 'file.f95', 'file.f03', 'file.f08'],
|
||||
\ 'fpcmake': ['file.fpc'],
|
||||
@@ -1249,4 +1250,31 @@ func Test_bas_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_frm_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['looks like FORM'], 'Xfile.frm')
|
||||
split Xfile.frm
|
||||
call assert_equal('form', &filetype)
|
||||
bwipe!
|
||||
|
||||
" Test dist#ft#FTfrm()
|
||||
|
||||
let g:filetype_frm = 'form'
|
||||
split Xfile.frm
|
||||
call assert_equal('form', &filetype)
|
||||
bwipe!
|
||||
unlet g:filetype_frm
|
||||
|
||||
" Visual Basic
|
||||
|
||||
call writefile(['Begin VB.Form Form1'], 'Xfile.frm')
|
||||
split Xfile.frm
|
||||
call assert_equal('vb', &filetype)
|
||||
bwipe!
|
||||
|
||||
call delete('Xfile.frm')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user