comparison runtime/filetype.vim @ 24347:1df930301857 v8.2.2714

patch 8.2.2714: filetype pattern ending in star is too far up Commit: https://github.com/vim/vim/commit/409da842db9dc24d88e415e518c02c05ac7de760 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 5 13:10:43 2021 +0200 patch 8.2.2714: filetype pattern ending in star is too far up Problem: Filetype pattern ending in star is too far up. Solution: Move down to where patterns ending in star belong. (closes https://github.com/vim/vim/issues/8065)
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Apr 2021 13:15:04 +0200
parents 201239ff51d7
children 1d126cb683c1
comparison
equal deleted inserted replaced
24346:3ef8863dc373 24347:1df930301857
1 " Vim support file to detect file types 1 " Vim support file to detect file types
2 " 2 "
3 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2021 Mar 19 4 " Last Change: 2021 Apr 05
5 5
6 " Listen very carefully, I will say this only once 6 " Listen very carefully, I will say this only once
7 if exists("did_load_filetypes") 7 if exists("did_load_filetypes")
8 finish 8 finish
9 endif 9 endif
1555 1555
1556 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. 1556 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
1557 " Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually 1557 " Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
1558 " bash scripts. 1558 " bash scripts.
1559 " NOTE: Patterns ending in a star are further down, these have lower priority. 1559 " NOTE: Patterns ending in a star are further down, these have lower priority.
1560 au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash") 1560 au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
1561 au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh") 1561 au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
1562 au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) 1562 au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
1563
1564 1563
1565 " Shell script (Arch Linux) or PHP file (Drupal) 1564 " Shell script (Arch Linux) or PHP file (Drupal)
1566 au BufNewFile,BufRead *.install 1565 au BufNewFile,BufRead *.install
1567 \ if getline(1) =~ '<?php' | 1566 \ if getline(1) =~ '<?php' |
1568 \ setf php | 1567 \ setf php |
2230 au BufNewFile,BufRead .reminders* call s:StarSetf('remind') 2229 au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
2231 2230
2232 " SGML catalog file 2231 " SGML catalog file
2233 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') 2232 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
2234 2233
2234 " avoid doc files being recognized a shell files
2235 au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
2236
2235 " Shell scripts ending in a star 2237 " Shell scripts ending in a star
2236 au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash") 2238 au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
2237 au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh") 2239 au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
2238 au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1)) 2240 au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
2239 2241
2240 " tcsh scripts ending in a star 2242 " tcsh scripts ending in a star
2241 au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh") 2243 au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh")