From cdd8540a20e2dbd2288b254a412ad8fa7d4bfbc8 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 2 Aug 2019 19:43:39 -0400 Subject: [PATCH 1/4] vim-patch:8.1.1187: cannot recognize Pipfile Problem: Cannot recognize Pipfile. Solution: Use existing filetypes. (Charles Ross, closes vim/vim#4280) https://github.com/vim/vim/commit/3a4c53ba51c01b8fea68972453a71c55cf32edbe --- runtime/filetype.vim | 7 ++++++- src/nvim/testdir/test_filetype.vim | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 473c169061..6922565192 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1173,6 +1173,10 @@ au BufNewFile,BufRead *.rcp setf pilrc " Pine config au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine +" Pipenv Pipfiles +au BufNewFile,BufRead Pipfile setf config +au BufNewFile,BufRead Pipfile.lock setf json + " PL/1, PL/I au BufNewFile,BufRead *.pli,*.pl1 setf pli @@ -1865,7 +1869,8 @@ au BufNewFile,BufRead *.xmi setf xml au BufNewFile,BufRead *.csproj,*.csproj.user setf xml " Qt Linguist translation source and Qt User Interface Files are XML -au BufNewFile,BufRead *.ts,*.ui setf xml +" However, for .ts Typescript is more common. +au BufNewFile,BufRead *.ui setf xml " TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull) au BufNewFile,BufRead *.tpm setf xml diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 897f736d76..779ee98316 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -102,7 +102,7 @@ let s:filename_checks = { \ 'coco': ['file.atg'], \ 'conaryrecipe': ['file.recipe'], \ 'conf': ['auto.master'], - \ 'config': ['configure.in', 'configure.ac'], + \ 'config': ['configure.in', 'configure.ac', 'Pipfile'], \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi'], \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'], \ 'crm': ['file.crm'], @@ -223,7 +223,7 @@ let s:filename_checks = { \ 'jgraph': ['file.jgr'], \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx'], - \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest'], + \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest', 'Pipfile.lock'], \ 'jsp': ['file.jsp'], \ 'kconfig': ['Kconfig', 'Kconfig.debug'], \ 'kivy': ['file.kv'], From d827a750f71281faa28e497ef40ada645789566f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 2 Aug 2019 19:46:21 -0400 Subject: [PATCH 2/4] vim-patch:8.1.1761: filetype "vuejs" causes problems for some users Problem: Filetype "vuejs" causes problems for some users. Solution: Rename to "vue". https://github.com/vim/vim/commit/4248111497ab78f45d3d48576740949778a1e76b --- runtime/filetype.vim | 3 +++ src/nvim/testdir/test_filetype.vim | 1 + 2 files changed, 4 insertions(+) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6922565192..600d323bbd 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -706,6 +706,9 @@ au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml() " Vue.js Single File Component au BufNewFile,BufRead *.vue setf vuejs +" Vue.js Single File Component +au BufNewFile,BufRead *.vue setf vue + " HTML with Ruby - eRuby au BufNewFile,BufRead *.erb,*.rhtml setf eruby diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 779ee98316..d4167114c8 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -474,6 +474,7 @@ let s:filename_checks = { \ 'voscm': ['file.cm'], \ 'vrml': ['file.wrl'], \ 'vroom': ['file.vroom'], + \ 'vue': ['file.vue'], \ 'wast': ['file.wast', 'file.wat'], \ 'webmacro': ['file.wm'], \ 'wget': ['.wgetrc', 'wgetrc'], From 12fe0cf5f9a56a71394ebf35a0ba9f4efc7e1702 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 2 Aug 2019 19:46:54 -0400 Subject: [PATCH 3/4] vim-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. https://github.com/vim/vim/commit/c273405188cc2f19e949089cda1f92bd81610dac --- runtime/filetype.vim | 15 ++++++--------- src/nvim/testdir/test_filetype.vim | 14 ++++++++------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 600d323bbd..4cc2f49a63 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2019 May 06 +" Last Change: 2019 Jul 27 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -703,12 +703,6 @@ au BufNewFile,BufRead *.t.html setf tilde " HTML (.shtml and .stm for server side) au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml() -" Vue.js Single File Component -au BufNewFile,BufRead *.vue setf vuejs - -" Vue.js Single File Component -au BufNewFile,BufRead *.vue setf vue - " HTML with Ruby - eRuby au BufNewFile,BufRead *.erb,*.rhtml setf eruby @@ -1781,12 +1775,15 @@ au BufNewFile,BufRead *.wrl setf vrml " Vroom (vim testing and executable documentation) au BufNewFile,BufRead *.vroom setf vroom -" Webmacro -au BufNewFile,BufRead *.wm setf webmacro +" Vue.js Single File Component +au BufNewFile,BufRead *.vue setf vue " WebAssembly au BufNewFile,BufRead *.wast,*.wat setf wast +" Webmacro +au BufNewFile,BufRead *.wm setf webmacro + " Wget config au BufNewFile,BufRead .wgetrc,wgetrc setf wget diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index d4167114c8..8193b8a265 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -44,8 +44,10 @@ endfunc " Filetypes detected just from matching the file name. let s:filename_checks = { + \ '8th': ['file.8th'], \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc'], \ 'a65': ['file.a65'], + \ 'aap': ['file.aap'], \ 'abap': ['file.abap'], \ 'abc': ['file.abc'], \ 'abel': ['file.abl'], @@ -56,7 +58,8 @@ let s:filename_checks = { \ 'aml': ['file.aml'], \ 'ampl': ['file.run'], \ 'ant': ['build.xml'], - \ 'apache': ['.htaccess', '/etc/httpd/file.conf'], + \ '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'], + \ 'apachestyle': ['/etc/proftpd/file.config,/etc/proftpd/conf.file/file'], \ 'applescript': ['file.scpt'], \ 'aptconf': ['apt.conf', '/.aptitude/config'], \ 'arch': ['.arch-inventory'], @@ -81,7 +84,7 @@ let s:filename_checks = { \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c'], \ 'cabal': ['file.cabal'], \ 'calendar': ['calendar'], - \ 'catalog': ['catalog'], + \ 'catalog': ['catalog', 'sgml.catalogfile'], \ 'cdl': ['file.cdl'], \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'], \ 'cdrtoc': ['file.toc'], @@ -424,7 +427,7 @@ let s:filename_checks = { \ 'svg': ['file.svg'], \ 'svn': ['svn-commitfile.tmp'], \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf'], - \ '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'], + \ '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'], \ 'systemverilog': ['file.sv', 'file.svh'], \ 'tags': ['tags'], \ 'tak': ['file.tak'], @@ -467,7 +470,7 @@ let s:filename_checks = { \ 'verilog': ['file.v'], \ 'verilogams': ['file.va', 'file.vams'], \ 'vgrindefs': ['vgrindefs'], - \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst'], + \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123'], \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc'], \ 'viminfo': ['.viminfo', '_viminfo'], \ 'vmasm': ['file.mar'], @@ -502,7 +505,6 @@ let s:filename_checks = { \ 'zimbutempl': ['file.zut'], \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh'], \ - \ 'aap': ['file.aap'], \ 'help': [$VIMRUNTIME . '/doc/help.txt'], \ 'xpm': ['file.xpm'], \ } @@ -516,7 +518,7 @@ func CheckItems(checks) for i in range(0, len(names) - 1) new try - exe 'edit ' . names[i] + exe 'edit ' . fnameescape(names[i]) catch call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg) endtry From 620a9064069dd7f9e15782c24a5260ad1b25b445 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 2 Aug 2019 19:50:20 -0400 Subject: [PATCH 4/4] vim-patch:8.1.1775: error message may be empty in filetype test Problem: Error message may be empty in filetype test. Solution: Use v:exception instead. (Daniel Hahler, closs vim/vim#4744) https://github.com/vim/vim/commit/eee9f65b2a213e9031f172d9d3b22adad6cb985d --- src/nvim/testdir/test_filetype.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 8193b8a265..e6d4933797 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -520,7 +520,7 @@ func CheckItems(checks) try exe 'edit ' . fnameescape(names[i]) catch - call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg) + call assert_report('cannot edit "' . names[i] . '": ' . v:exception) endtry call assert_equal(ft, &filetype, 'with file name: ' . names[i]) bwipe!