annotate runtime/ftplugin/spec.vim @ 7439:63a96fadf679 v7.4.1023

commit https://github.com/vim/vim/commit/2c15f6aa8fd057721e35d03523577b41cf7aaad5 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 2 15:00:30 2016 +0100 patch 7.4.1023 Problem: The distribution files for MS-Windows use CR-LF, which is inconsistent with what one gets from github. Solution: Use LF in the distribution files.
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Jan 2016 15:15:04 +0100
parents 0303182665d5
children ecb621205ed1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Plugin to update the %changelog section of RPM spec files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Filename: spec.vim
5697
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
3 " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
4 " Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
5 " Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
12 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
13 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
14
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 if !exists("no_plugin_maps") && !exists("no_spec_maps")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 if !hasmapto("<Plug>SpecChangelog")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 map <buffer> <LocalLeader>c <Plug>SpecChangelog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5697
diff changeset
21 if !hasmapto("call <SID>SpecChangelog(\"\")<CR>")
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5697
diff changeset
22 noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5697
diff changeset
23 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
25 if !exists("*s:GetRelVer")
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
26 function! s:GetRelVer()
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
27 if has('python')
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
28 python << PYEND
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
29 import sys, datetime, shutil, tempfile
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
30 import vim
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
31
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
32 try:
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
33 import rpm
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
34 except ImportError:
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
35 pass
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
36 else:
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
37 specfile = vim.current.buffer.name
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
38 if specfile:
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
39 spec = rpm.spec(specfile)
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
40 headers = spec.packages[0].header
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
41 version = headers['Version']
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
42 release = ".".join(headers['Release'].split(".")[:-1])
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
43 vim.command("let ver = " + version)
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
44 vim.command("let rel = " + release)
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
45 PYEND
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
46 endif
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
47 endfunction
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
48 endif
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
49
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 if !exists("*s:SpecChangelog")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 function s:SpecChangelog(format)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 if strlen(a:format) == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 if !exists("g:spec_chglog_format")
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
54 let email = input("Name <email address>: ")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 let g:spec_chglog_format = "%a %b %d %Y " . l:email
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 echo "\r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let format = g:spec_chglog_format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 if !exists("g:spec_chglog_format")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 let g:spec_chglog_format = a:format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 let format = a:format
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 let line = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 let name = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 let ver = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 let rel = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 let nameline = -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 let verline = -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let relline = -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 let chgline = -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 while (line <= line("$"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 let linestr = getline(line)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 if (name == "" && linestr =~? '^Name:')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 let nameline = line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 elseif (ver == "" && linestr =~? '^Version:')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 let verline = line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 elseif (rel == "" && linestr =~? '^Release:')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 let relline = line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 let rel = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 elseif (linestr =~? '^%changelog')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 let chgline = line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 execute line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 let line = line+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 if (nameline != -1 && verline != -1 && relline != -1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 let include_release_info = exists("g:spec_chglog_release_info")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 let name = s:ParseRpmVars(name, nameline)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 let ver = s:ParseRpmVars(ver, verline)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 let rel = s:ParseRpmVars(rel, relline)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 let include_release_info = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 endif
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
99
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
100 call s:GetRelVer()
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
101
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 if (chgline == -1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 if (option == 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 call append(line("$"),"")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 call append(line("$"),"%changelog")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 execute line("$")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 let chgline = line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 elseif (option == 2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 call append(line("."),"%changelog")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 normal j
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 chgline = line(".")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 if (chgline != -1)
6823
0303182665d5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6647
diff changeset
116 let parsed_format = "* ".strftime(format)." - ".ver."-".rel
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 let release_info = "+ ".name."-".ver."-".rel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 let wrong_format = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 let wrong_release = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 let insert_line = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 if (getline(chgline+1) != parsed_format)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 let wrong_format = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 if (include_release_info && getline(chgline+2) != release_info)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 let wrong_release = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 if (wrong_format || wrong_release)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 if (include_release_info && !wrong_release && !exists("g:spec_chglog_never_increase_release"))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 let option = confirm("Increase release? ","&Yes\n&No",1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 if (option == 1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 execute relline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 normal 
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 let rel = substitute(strpart(getline(relline),8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 let release_info = "+ ".name."-".ver."-".rel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 let n = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 call append(chgline+n, parsed_format)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 if include_release_info
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 let n = n + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 call append(chgline+n, release_info)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 let n = n + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 call append(chgline+n,"- ")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 let n = n + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 call append(chgline+n,"")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 let insert_line = chgline+n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 let line = chgline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 if !exists("g:spec_chglog_prepend")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 while !(getline(line+2) =~ '^\( *\|\*.*\)$')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 let line = line+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 call append(line+1,"- ")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 let insert_line = line+2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 execute insert_line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 startinsert!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 if !exists("*s:ParseRpmVars")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 function s:ParseRpmVars(str, strline)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 let end = -1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 let ret = ""
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 while (1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 let start = match(a:str, "\%{", end+1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 if (start == -1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 let ret = ret . strpart(a:str, end+1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 let ret = ret . strpart(a:str, end+1, start-(end+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 let end = match(a:str, "}", start)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 if (end == -1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 let ret = ret . strpart(a:str, start)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 let varname = strpart(a:str, start+2, end-(start+2))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 execute a:strline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 let definestr = "^[ \t]*%define[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 let linenum = search(definestr, "bW")
5697
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
184 if (linenum == 0)
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
185 let definestr = substitute(definestr, "%define", "%global", "")
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
186 let linenum = search(definestr, "bW")
c2098c3095e7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
187 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 if (linenum != -1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 let ret = ret . substitute(getline(linenum), definestr, "\\1", "")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 let ret = ret . strpart(str, start, end+1-start)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 return ret
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 endfunction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 " The following lines, along with the macros/matchit.vim plugin,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 " make it easy to navigate the different sections of a spec file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 " with the % key (thanks to Max Ischenko).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 let b:match_ignorecase = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 let b:match_words =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 \ '^Name:^%description:^%clean:^%setup:^%build:^%install:^%files:' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 \ '^%package:^%preun:^%postun:^%changelog'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
207 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
208 unlet s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
209
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
210 let b:undo_ftplugin = "unlet! b:match_ignorecase b:match_words"