]> granicus.if.org Git - vim/commitdiff
patch 8.2.2714: filetype pattern ending in star is too far up v8.2.2714
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Apr 2021 11:10:43 +0000 (13:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Apr 2021 11:10:43 +0000 (13:10 +0200)
Problem:    Filetype pattern ending in star is too far up.
Solution:   Move down to where patterns ending in star belong. (closes #8065)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index f85ac81d3d6bdb9a1d9d2a1916e164ec7d9ed59f..c4e028a5e9f3d1bcd8d33fc895cb3c3e9580ba84 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2021 Mar 19
+" Last Change: 2021 Apr 05
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1557,11 +1557,10 @@ au BufNewFile,BufRead catalog                   setf catalog
 " Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
 " bash scripts.
 " NOTE: Patterns ending in a star are further down, these have lower priority.
-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")
+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")
 au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
 au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
 
-
 " Shell script (Arch Linux) or PHP file (Drupal)
 au BufNewFile,BufRead *.install
        \ if getline(1) =~ '<?php' |
@@ -2232,8 +2231,11 @@ au BufNewFile,BufRead .reminders*                call s:StarSetf('remind')
 " SGML catalog file
 au BufNewFile,BufRead sgml.catalog*            call s:StarSetf('catalog')
 
+" avoid doc files being recognized a shell files
+au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
+
 " Shell scripts ending in a star
-au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash")
+au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
 au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
 au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
 
index 207648f61427b9335e13b0fefc1772a1dbb74c67..64c2595c2f104b9822489420378768d8bfa5de3e 100644 (file)
@@ -434,7 +434,7 @@ let s:filename_checks = {
     \ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf', 'any/etc/sensors.conf', 'any/etc/sensors3.conf'],
     \ 'services': ['/etc/services', 'any/etc/services'],
     \ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'],
-    \ 'sh': ['/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf'],
+    \ 'sh': ['.bashrc', 'file.bash', '/usr/share/doc/bash-completion/filter.sh','/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf'],
     \ 'sieve': ['file.siv', 'file.sieve'],
     \ 'simula': ['file.sim'],
     \ 'sinda': ['file.sin', 'file.s85'],
@@ -487,7 +487,7 @@ let s:filename_checks = {
     \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'],
     \ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'],
     \ 'texmf': ['texmf.cnf'],
-    \ 'text': ['file.text', 'README'],
+    \ 'text': ['file.text', 'README', '/usr/share/doc/bash-completion/AUTHORS'],
     \ 'tf': ['file.tf', '.tfrc', 'tfrc'],
     \ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'],
     \ 'tilde': ['file.t.html'],
index 5fcc0f627c28f543f44820d06370a7b898219304..2d3368dab4e0218c3b200ebc418208618049e6a9 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2714,
 /**/
     2713,
 /**/