summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0771
blob: 715f925b9b24379283cacc2a20468689cfad9574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0771
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0771
Problem:    Some shell filetype patterns end in a star.
Solution:   Make sure that patterns not ending in a star are preferred.
Files:	    runtime/filetype.vim, runtime/autoload/dist/ft.vim


*** ../vim-8.1.0770/runtime/filetype.vim	2018-11-03 19:52:11.333956689 +0100
--- runtime/filetype.vim	2019-01-18 21:20:27.678878376 +0100
***************
*** 1462,1470 ****
  
  " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
  " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
! au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* 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
--- 1462,1472 ----
  
  " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
  " Gentoo ebuilds and Arch Linux PKGBUILDs 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 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
***************
*** 1475,1488 ****
  	\ endif
  
  " tcsh scripts
! au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login	call dist#ft#SetFileTypeShell("tcsh")
  
  " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
! au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call dist#ft#CSH()
  
  " Z-Shell script
  au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks  setf zsh
! au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh')
  au BufNewFile,BufRead *.zsh			setf zsh
  
  " Scheme
--- 1477,1490 ----
  	\ endif
  
  " tcsh scripts
! au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login	call dist#ft#SetFileTypeShell("tcsh")
  
  " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
! au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call dist#ft#CSH()
  
  " Z-Shell script
  au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks  setf zsh
! au BufNewFile,BufRead .zsh,.zlog,.zcompdump  	call s:StarSetf('zsh')
  au BufNewFile,BufRead *.zsh			setf zsh
  
  " Scheme
***************
*** 2074,2079 ****
--- 2076,2095 ----
  " Remind
  au BufNewFile,BufRead .reminders*		call s:StarSetf('remind')
  
+ " Shell scripts ending in a star
+ au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
+ au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
+ au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
+ 
+ " tcsh scripts ending in a star
+ au BufNewFile,BufRead .tcshrc*	call dist#ft#SetFileTypeShell("tcsh")
+ 
+ " csh scripts ending in a star
+ au BufNewFile,BufRead .login*,.cshrc*  call dist#ft#CSH()
+ 
+ " Z-Shell script ending in a star
+ au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh')
+ 
  " Vim script
  au BufNewFile,BufRead *vimrc*			call s:StarSetf('vim')
  
*** ../vim-8.1.0770/runtime/autoload/dist/ft.vim	2017-12-05 21:37:31.000000000 +0100
--- runtime/autoload/dist/ft.vim	2019-01-18 21:19:20.775377125 +0100
***************
*** 126,132 ****
  " This function checks if one of the first ten lines start with a '@'.  In
  " that case it is probably a change file.
  " If the first line starts with # or ! it's probably a ch file.
! " If a line has "main", "include", "//" ir "/*" it's probably ch.
  " Otherwise CHILL is assumed.
  func dist#ft#FTchange()
    let lnum = 1
--- 126,132 ----
  " This function checks if one of the first ten lines start with a '@'.  In
  " that case it is probably a change file.
  " If the first line starts with # or ! it's probably a ch file.
! " If a line has "main", "include", "//" or "/*" it's probably ch.
  " Otherwise CHILL is assumed.
  func dist#ft#FTchange()
    let lnum = 1
***************
*** 484,489 ****
--- 484,493 ----
  
  " Called from filetype.vim and scripts.vim.
  func dist#ft#SetFileTypeSH(name)
+   if did_filetype()
+     " Filetype was already detected
+     return
+   endif
    if expand("<amatch>") =~ g:ft_ignore_pat
      return
    endif
***************
*** 531,536 ****
--- 535,544 ----
  " as used for Tcl.
  " Also called from scripts.vim, thus can't be local to this script.
  func dist#ft#SetFileTypeShell(name)
+   if did_filetype()
+     " Filetype was already detected
+     return
+   endif
    if expand("<amatch>") =~ g:ft_ignore_pat
      return
    endif
***************
*** 551,556 ****
--- 559,568 ----
  endfunc
  
  func dist#ft#CSH()
+   if did_filetype()
+     " Filetype was already detected
+     return
+   endif
    if exists("g:filetype_csh")
      call dist#ft#SetFileTypeShell(g:filetype_csh)
    elseif &shell =~ "tcsh"
***************
*** 632,638 ****
  " Choose context, plaintex, or tex (LaTeX) based on these rules:
  " 1. Check the first line of the file for "%&<format>".
  " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
! " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc.
  func dist#ft#FTtex()
    let firstline = getline(1)
    if firstline =~ '^%&\s*\a\+'
--- 644,650 ----
  " Choose context, plaintex, or tex (LaTeX) based on these rules:
  " 1. Check the first line of the file for "%&<format>".
  " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
! " 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc.
  func dist#ft#FTtex()
    let firstline = getline(1)
    if firstline =~ '^%&\s*\a\+'
*** ../vim-8.1.0770/src/version.c	2019-01-17 22:28:18.901373188 +0100
--- src/version.c	2019-01-18 21:44:39.609527401 +0100
***************
*** 793,794 ****
--- 793,796 ----
  {   /* Add new patch number below this line */
+ /**/
+     771,
  /**/

-- 
Hear about the guy who played a blank tape at full blast?
The mime next door went nuts.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///