Mercurial > vim
comparison src/testdir/test_filetype.vim @ 17528:62a6d99082f7 v8.1.1762
patch 8.1.1762: some filetype rules are in the wrong place
commit https://github.com/vim/vim/commit/c273405188cc2f19e949089cda1f92bd81610dac
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 27 21:57:21 2019 +0200
patch 8.1.1762: some filetype rules are in the wrong place
Problem: Some filetype rules are in the wrong place.
Solution: Move to the right place. Add a few more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Jul 2019 22:00:06 +0200 |
parents | ae379e753465 |
children | c2eb5118ba89 |
comparison
equal
deleted
inserted
replaced
17527:038f42e497cc | 17528:62a6d99082f7 |
---|---|
42 filetype off | 42 filetype off |
43 endfunc | 43 endfunc |
44 | 44 |
45 " Filetypes detected just from matching the file name. | 45 " Filetypes detected just from matching the file name. |
46 let s:filename_checks = { | 46 let s:filename_checks = { |
47 \ '8th': ['file.8th'], | |
47 \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc'], | 48 \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc'], |
48 \ 'a65': ['file.a65'], | 49 \ 'a65': ['file.a65'], |
50 \ 'aap': ['file.aap'], | |
49 \ 'abap': ['file.abap'], | 51 \ 'abap': ['file.abap'], |
50 \ 'abc': ['file.abc'], | 52 \ 'abc': ['file.abc'], |
51 \ 'abel': ['file.abl'], | 53 \ 'abel': ['file.abl'], |
52 \ 'acedb': ['file.wrm'], | 54 \ 'acedb': ['file.wrm'], |
53 \ 'ada': ['file.adb', 'file.ads', 'file.ada', 'file.gpr'], | 55 \ 'ada': ['file.adb', 'file.ads', 'file.ada', 'file.gpr'], |
54 \ 'ahdl': ['file.tdf'], | 56 \ 'ahdl': ['file.tdf'], |
55 \ 'alsaconf': ['.asoundrc', '/usr/share/alsa/alsa.conf', '/etc/asound.conf'], | 57 \ 'alsaconf': ['.asoundrc', '/usr/share/alsa/alsa.conf', '/etc/asound.conf'], |
56 \ 'aml': ['file.aml'], | 58 \ 'aml': ['file.aml'], |
57 \ 'ampl': ['file.run'], | 59 \ 'ampl': ['file.run'], |
58 \ 'ant': ['build.xml'], | 60 \ 'ant': ['build.xml'], |
59 \ 'apache': ['.htaccess', '/etc/httpd/file.conf'], | 61 \ 'apache': ['.htaccess', '/etc/httpd/file.conf', '/etc/apache2/sites-2/file.com', '/etc/apache2/some.config', '/etc/apache2/conf.file/conf', '/etc/apache2/mods-some/file', '/etc/apache2/sites-some/file', '/etc/httpd/conf.d/file.config'], |
62 \ 'apachestyle': ['/etc/proftpd/file.config,/etc/proftpd/conf.file/file'], | |
60 \ 'applescript': ['file.scpt'], | 63 \ 'applescript': ['file.scpt'], |
61 \ 'aptconf': ['apt.conf', '/.aptitude/config'], | 64 \ 'aptconf': ['apt.conf', '/.aptitude/config'], |
62 \ 'arch': ['.arch-inventory'], | 65 \ 'arch': ['.arch-inventory'], |
63 \ 'arduino': ['file.ino', 'file.pde'], | 66 \ 'arduino': ['file.ino', 'file.pde'], |
64 \ 'art': ['file.art'], | 67 \ 'art': ['file.art'], |
79 \ 'bst': ['file.bst'], | 82 \ 'bst': ['file.bst'], |
80 \ 'bzr': ['bzr_log.any'], | 83 \ 'bzr': ['bzr_log.any'], |
81 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'], | 84 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'], |
82 \ 'cabal': ['file.cabal'], | 85 \ 'cabal': ['file.cabal'], |
83 \ 'calendar': ['calendar'], | 86 \ 'calendar': ['calendar'], |
84 \ 'catalog': ['catalog'], | 87 \ 'catalog': ['catalog', 'sgml.catalogfile'], |
85 \ 'cdl': ['file.cdl'], | 88 \ 'cdl': ['file.cdl'], |
86 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'], | 89 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'], |
87 \ 'cdrtoc': ['file.toc'], | 90 \ 'cdrtoc': ['file.toc'], |
88 \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], | 91 \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], |
89 \ 'cfengine': ['cfengine.conf'], | 92 \ 'cfengine': ['cfengine.conf'], |
423 \ 'stp': ['file.stp'], | 426 \ 'stp': ['file.stp'], |
424 \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp'], | 427 \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp'], |
425 \ 'svg': ['file.svg'], | 428 \ 'svg': ['file.svg'], |
426 \ 'svn': ['svn-commitfile.tmp'], | 429 \ 'svn': ['svn-commitfile.tmp'], |
427 \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf'], | 430 \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf'], |
428 \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.mount', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer'], | 431 \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.mount', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer', '/etc/systemd/system/some.d/file.conf', '/etc/systemd/system/some.d/.#file'], |
429 \ 'systemverilog': ['file.sv', 'file.svh'], | 432 \ 'systemverilog': ['file.sv', 'file.svh'], |
430 \ 'tags': ['tags'], | 433 \ 'tags': ['tags'], |
431 \ 'tak': ['file.tak'], | 434 \ 'tak': ['file.tak'], |
432 \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'], | 435 \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'], |
433 \ 'taskedit': ['file.task'], | 436 \ 'taskedit': ['file.task'], |
466 \ 'vb': ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'], | 469 \ 'vb': ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'], |
467 \ 'vera': ['file.vr', 'file.vri', 'file.vrh'], | 470 \ 'vera': ['file.vr', 'file.vri', 'file.vrh'], |
468 \ 'verilog': ['file.v'], | 471 \ 'verilog': ['file.v'], |
469 \ 'verilogams': ['file.va', 'file.vams'], | 472 \ 'verilogams': ['file.va', 'file.vams'], |
470 \ 'vgrindefs': ['vgrindefs'], | 473 \ 'vgrindefs': ['vgrindefs'], |
471 \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst'], | 474 \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123'], |
472 \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc'], | 475 \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc'], |
473 \ 'viminfo': ['.viminfo', '_viminfo'], | 476 \ 'viminfo': ['.viminfo', '_viminfo'], |
474 \ 'vmasm': ['file.mar'], | 477 \ 'vmasm': ['file.mar'], |
475 \ 'voscm': ['file.cm'], | 478 \ 'voscm': ['file.cm'], |
476 \ 'vrml': ['file.wrl'], | 479 \ 'vrml': ['file.wrl'], |
501 \ 'z8a': ['file.z8a'], | 504 \ 'z8a': ['file.z8a'], |
502 \ 'zimbu': ['file.zu'], | 505 \ 'zimbu': ['file.zu'], |
503 \ 'zimbutempl': ['file.zut'], | 506 \ 'zimbutempl': ['file.zut'], |
504 \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh'], | 507 \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh'], |
505 \ | 508 \ |
506 \ 'aap': ['file.aap'], | |
507 \ 'help': [$VIMRUNTIME . '/doc/help.txt'], | 509 \ 'help': [$VIMRUNTIME . '/doc/help.txt'], |
508 \ 'xpm': ['file.xpm'], | 510 \ 'xpm': ['file.xpm'], |
509 \ } | 511 \ } |
510 | 512 |
511 let s:filename_case_checks = { | 513 let s:filename_case_checks = { |
515 func CheckItems(checks) | 517 func CheckItems(checks) |
516 for [ft, names] in items(a:checks) | 518 for [ft, names] in items(a:checks) |
517 for i in range(0, len(names) - 1) | 519 for i in range(0, len(names) - 1) |
518 new | 520 new |
519 try | 521 try |
520 exe 'edit ' . names[i] | 522 exe 'edit ' . fnameescape(names[i]) |
521 catch | 523 catch |
522 call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg) | 524 call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg) |
523 endtry | 525 endtry |
524 if &filetype == '' && &readonly | 526 if &filetype == '' && &readonly |
525 " File exists but not able to edit it (permission denied) | 527 " File exists but not able to edit it (permission denied) |