To: vim_dev@googlegroups.com Subject: Patch 9.0.1601 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1601 Problem: Filetype detection fails for *.conf file without comments. (Dmitrii Tcyganok) Solution: Use "conf" filetype as a fallback for an empty .conf file. (closes #12487, closes #12483) Files: runtime/filetype.vim, src/testdir/test_filetype.vim *** ../vim-9.0.1600/runtime/filetype.vim 2023-05-28 22:11:17.800701909 +0100 --- runtime/filetype.vim 2023-06-03 17:55:22.172195149 +0100 *************** *** 2811,2818 **** " Generic configuration file. Use FALLBACK, it's just guessing! au filetypedetect BufNewFile,BufRead,StdinReadPost * \ if !did_filetype() && expand("") !~ g:ft_ignore_pat ! \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' ! \ || getline(4) =~ '^#' || getline(5) =~ '^#') | \ setf FALLBACK conf | \ endif --- 2811,2820 ---- " Generic configuration file. Use FALLBACK, it's just guessing! au filetypedetect BufNewFile,BufRead,StdinReadPost * \ if !did_filetype() && expand("") !~ g:ft_ignore_pat ! \ && (expand("") =~# '\.conf$' ! \ || getline(1) =~ '^#' || getline(2) =~ '^#' ! \ || getline(3) =~ '^#' || getline(4) =~ '^#' ! \ || getline(5) =~ '^#') | \ setf FALLBACK conf | \ endif *** ../vim-9.0.1600/src/testdir/test_filetype.vim 2023-05-29 19:59:38.217805411 +0100 --- src/testdir/test_filetype.vim 2023-06-03 17:49:27.324471067 +0100 *************** *** 122,128 **** cobol: ['file.cbl', 'file.cob', 'file.lib'], coco: ['file.atg'], conaryrecipe: ['file.recipe'], ! conf: ['auto.master'], config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'], confini: ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], --- 122,128 ---- cobol: ['file.cbl', 'file.cob', 'file.lib'], coco: ['file.atg'], conaryrecipe: ['file.recipe'], ! conf: ['auto.master', 'file.conf'], config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'], confini: ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], *** ../vim-9.0.1600/src/version.c 2023-06-03 17:11:40.789005400 +0100 --- src/version.c 2023-06-03 17:52:48.224109504 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1601, /**/ -- hundred-and-one symptoms of being an internet addict: 103. When you find yourself in the "Computer" section of Barnes & Noble enjoying yourself. /// 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 ///