mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 9.0.1797: Vimball/Visual Basic filetype detection conflict
Problem: Vimball/Visual Basic filetype detection conflict Solution: runtime(vb): Improve Vimball and Visual Basic detection logic Only run Vimball Archiver's BufEnter autocommand on Vimball archives. Fixes #2694. closes: #12899 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
committed by
Christian Brabandt
parent
5c018bee0e
commit
f97f6bbf56
@@ -205,7 +205,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
||||
dnsmasq: ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'],
|
||||
dockerfile: ['Containerfile', 'Dockerfile', 'dockerfile', 'file.Dockerfile', 'file.dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
|
||||
dosbatch: ['file.bat'],
|
||||
dosini: ['/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap'],
|
||||
dosini: ['/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap', 'file.vbp'],
|
||||
dot: ['file.dot', 'file.gv'],
|
||||
dracula: ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'],
|
||||
dtd: ['file.dtd'],
|
||||
@@ -759,7 +759,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
||||
usw2kagtlog: ['usw2kagt.log', 'USW2KAGT.LOG', 'usw2kagt.file.log', 'USW2KAGT.FILE.LOG', 'file.usw2kagt.log', 'FILE.USW2KAGT.LOG'],
|
||||
v: ['file.vsh', 'file.vv'],
|
||||
vala: ['file.vala'],
|
||||
vb: ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'],
|
||||
vb: ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl', 'file.dob', 'file.dsr'],
|
||||
vdf: ['file.vdf'],
|
||||
vdmpp: ['file.vpp', 'file.vdmpp'],
|
||||
vdmrt: ['file.vdmrt'],
|
||||
@@ -769,7 +769,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
||||
vgrindefs: ['vgrindefs'],
|
||||
vhdl: ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'],
|
||||
vhs: ['file.tape'],
|
||||
vim: ['file.vim', 'file.vba', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'],
|
||||
vim: ['file.vim', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'],
|
||||
viminfo: ['.viminfo', '_viminfo'],
|
||||
vmasm: ['file.mar'],
|
||||
voscm: ['file.cm'],
|
||||
@@ -1379,7 +1379,7 @@ func Test_frm_file()
|
||||
|
||||
" Visual Basic
|
||||
|
||||
call writefile(['Begin VB.Form Form1'], 'Xfile.frm')
|
||||
call writefile(['VERSION 5.00', 'Begin VB.Form Form1'], 'Xfile.frm')
|
||||
split Xfile.frm
|
||||
call assert_equal('vb', &filetype)
|
||||
bwipe!
|
||||
@@ -2288,4 +2288,26 @@ func Test_typ_file()
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_vba_file()
|
||||
filetype on
|
||||
|
||||
" Test dist#ft#FTvba()
|
||||
|
||||
" Visual Basic
|
||||
|
||||
call writefile(['looks like Visual Basic'], 'Xfile.vba', 'D')
|
||||
split Xfile.vba
|
||||
call assert_equal('vb', &filetype)
|
||||
bwipe!
|
||||
|
||||
" Vimball Archiver (ft=vim)
|
||||
|
||||
call writefile(['" Vimball Archiver by Charles E. Campbell, Ph.D.', 'UseVimball', 'finish'], 'Xfile.vba', 'D')
|
||||
split Xfile.vba
|
||||
call assert_equal('vim', &filetype)
|
||||
bwipe!
|
||||
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1797,
|
||||
/**/
|
||||
1796,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user