To: vim_dev@googlegroups.com Subject: Patch 8.2.3491 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3491 Problem: xpm2 filetype dection is not so good. Solution: Adjust the check for xpm2. (closes #8914) Files: runtime/filetype.vim, src/testdir/test_filetype.vim *** ../vim-8.2.3490/runtime/filetype.vim 2021-10-04 20:41:41.233232256 +0100 --- runtime/filetype.vim 2021-10-04 20:39:30.063423129 +0100 *************** *** 2008,2021 **** " XHTML au BufNewFile,BufRead *.xhtml,*.xht setf xhtml ! " X Pixmap (dynamically sets colors, use BufEnter to make it work better) ! au BufEnter *.xpm \ if getline(1) =~ "XPM2" | \ setf xpm2 | \ else | \ setf xpm | \ endif ! au BufEnter *.xpm2 setf xpm2 " XFree86 config au BufNewFile,BufRead XF86Config --- 2008,2022 ---- " XHTML au BufNewFile,BufRead *.xhtml,*.xht setf xhtml ! " X Pixmap (dynamically sets colors, this used to trigger on BufEnter to make ! " it work better, but that breaks setting 'filetype' manually) ! au BufNewFile,BufRead *.xpm \ if getline(1) =~ "XPM2" | \ setf xpm2 | \ else | \ setf xpm | \ endif ! au BufNewFile,BufRead *.xpm2 setf xpm2 " XFree86 config au BufNewFile,BufRead XF86Config *** ../vim-8.2.3490/src/testdir/test_filetype.vim 2021-10-04 20:41:41.233232256 +0100 --- src/testdir/test_filetype.vim 2021-10-09 16:25:15.146544654 +0100 *************** *** 555,560 **** --- 555,561 ---- \ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'], \ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'], \ 'xf86conf': ['xorg.conf', 'xorg.conf-4'], + \ 'xpm': ['file.xpm'], \ 'xpm2': ['file.xpm2'], \ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'], \ 'xs': ['file.xs'], *************** *** 569,575 **** \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'], \ \ 'help': [$VIMRUNTIME . '/doc/help.txt'], - \ 'xpm': ['file.xpm'], \ } let s:filename_case_checks = { --- 570,575 ---- *************** *** 943,946 **** --- 943,959 ---- call delete('Xfile.m') filetype off endfunc + + func Test_xpm_file() + filetype on + + call writefile(['this is XPM2'], 'file.xpm') + split file.xpm + call assert_equal('xpm2', &filetype) + bwipe! + + call delete('file.xpm') + filetype off + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.3490/src/version.c 2021-10-09 15:39:20.463884398 +0100 --- src/version.c 2021-10-09 16:27:29.937284137 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3491, /**/ -- You cannot have a baby in one month by getting nine women pregnant. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///