annotate runtime/indent/vhdl.vim @ 9811:8dbd5f15c8fa

Added tag v7.4.2180 for changeset 6a28d0c6f92929c21307a78adb2cd4219f4b5325
author Christian Brabandt <cb@256bit.org>
date Sun, 07 Aug 2016 18:30:05 +0200
parents ecb621205ed1
children 63b0b7b79b25
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
1 " VHDL indent ('93 syntax)
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
2 " Language: VHDL
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
3 " Maintainer: Gerald Lai <laigera+vim?gmail.com>
9227
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
4 " Version: 1.60
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
5 " Last Change: 2016 Feb 26
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
6 " URL: http://www.vim.org/scripts/script.php?script_id=1450
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
7
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
8 " only load this indent file when no other was loaded
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
9 if exists("b:did_indent")
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
10 finish
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
11 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
12 let b:did_indent = 1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
13
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
14 " setup indent options for local VHDL buffer
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
15 setlocal indentexpr=GetVHDLindent()
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
16 setlocal indentkeys=!^F,o,O,0(,0)
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
17 setlocal indentkeys+==~begin,=~end\ ,=~end\ ,=~is,=~select,=~when
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
18 setlocal indentkeys+==~if,=~then,=~elsif,=~else
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
19 setlocal indentkeys+==~case,=~loop,=~for,=~generate,=~record,=~units,=~process,=~block,=~function,=~component,=~procedure
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
20 setlocal indentkeys+==~architecture,=~configuration,=~entity,=~package
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
21
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
22 " constants
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
23 " not a comment
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
24 let s:NC = '\%(--.*\)\@<!'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
25 " end of string
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
26 let s:ES = '\s*\%(--.*\)\=$'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
27 " no "end" keyword in front
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
28 let s:NE = '\%(\<end\s\+\)\@<!'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
29
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
30 " option to disable alignment of generic/port mappings
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
31 if !exists("g:vhdl_indent_genportmap")
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
32 let g:vhdl_indent_genportmap = 1
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
33 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
34
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
35 " option to disable alignment of right-hand side assignment "<=" statements
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
36 if !exists("g:vhdl_indent_rhsassign")
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
37 let g:vhdl_indent_rhsassign = 1
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
38 endif
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
39
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
40 " only define indent function once
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
41 if exists("*GetVHDLindent")
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
42 finish
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
43 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
44
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
45 function GetVHDLindent()
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
46 " store current line & string
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
47 let curn = v:lnum
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
48 let curs = getline(curn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
49
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
50 " find previous line that is not a comment
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
51 let prevn = prevnonblank(curn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
52 let prevs = getline(prevn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
53 while prevn > 0 && prevs =~ '^\s*--'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
54 let prevn = prevnonblank(prevn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
55 let prevs = getline(prevn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
56 endwhile
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
57 let prevs_noi = substitute(prevs, '^\s*', '', '')
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
58
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
59 " default indent starts as previous non-comment line's indent
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
60 let ind = prevn > 0 ? indent(prevn) : 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
61 " backup default
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
62 let ind2 = ind
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
63
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
64 " indent: special; kill string so it would not affect other filters
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
65 " keywords: "report" + string
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
66 " where: anywhere in current or previous line
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
67 let s0 = s:NC.'\<report\>\s*".*"'
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
68 if curs =~? s0
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
69 let curs = ""
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
70 endif
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
71 if prevs =~? s0
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
72 let prevs = ""
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
73 endif
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
74
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
75 " indent: previous line's comment position, otherwise follow next non-comment line if possible
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
76 " keyword: "--"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
77 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
78 if curs =~ '^\s*--'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
79 let pn = curn - 1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
80 let ps = getline(pn)
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
81 if curs =~ '^\s*--\s' && ps =~ '--'
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
82 return indent(pn) + stridx(substitute(ps, '^\s*', '', ''), '--')
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
83 else
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
84 " find nextnonblank line that is not a comment
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
85 let nn = nextnonblank(curn + 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
86 let ns = getline(nn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
87 while nn > 0 && ns =~ '^\s*--'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
88 let nn = nextnonblank(nn + 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
89 let ns = getline(nn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
90 endwhile
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
91 let n = indent(nn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
92 return n != -1 ? n : ind
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
93 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
94 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
95
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
96 " ****************************************************************************************
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
97 " indent: align generic variables & port names
3153
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
98 " keywords: "procedure" + name, "generic", "map", "port" + "(", provided current line is part of mapping
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
99 " where: anywhere in previous 2 lines
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
100 " find following previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
101 let pn = prevnonblank(prevn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
102 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
103 while pn > 0 && ps =~ '^\s*--'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
104 let pn = prevnonblank(pn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
105 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
106 endwhile
9227
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
107 if (curs =~ '^\s*)' || curs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@<!\w\+\s*\w*\s*\((.*)\)*\s*\%(=>\s*\S\+\|:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\s\+\)\)') && (prevs =~? s:NC.'\<\%(procedure\s\+\S\+\|generic\|map\|port\)\s*(\%(\s*\w\)\=' || (ps =~? s:NC.'\<\%(procedure\|generic\|map\|port\)'.s:ES && prevs =~ '^\s*('))
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
108 " align closing ")" with opening "("
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
109 if curs =~ '^\s*)'
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
110 return ind2 + stridx(prevs_noi, '(')
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
111 endif
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
112 let m = matchend(prevs_noi, '(\s*\ze\w')
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
113 if m != -1
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
114 return ind2 + m
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
115 else
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
116 if g:vhdl_indent_genportmap
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
117 return ind2 + stridx(prevs_noi, '(') + &sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
118 else
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
119 return ind2 + &sw
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
120 endif
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
121 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
122 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
123
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
124 " indent: align conditional/select statement
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
125 " keywords: variable + "<=" without ";" ending
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
126 " where: start of previous line
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
127 if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES
1619
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
128 if g:vhdl_indent_rhsassign
b9740fb41986 updated for version 7.2a
vimboss
parents: 1121
diff changeset
129 return ind2 + matchend(prevs_noi, '<=\s*\ze.')
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
130 else
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
131 return ind2 + &sw
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
132 endif
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
133 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
134
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
135 " indent: backtrace previous non-comment lines for next smaller or equal size indent
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
136 " keywords: "end" + "record", "units"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
137 " where: start of previous line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
138 " keyword: ")"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
139 " where: start of previous line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
140 " keyword: without "<=" + ";" ending
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
141 " where: anywhere in previous line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
142 " keyword: "=>" + ")" ending, provided current line does not begin with ")"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
143 " where: anywhere in previous line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
144 " _note_: indent allowed to leave this filter
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
145 let m = 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
146 if prevs =~? '^\s*end\s\+\%(record\|units\)\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
147 let m = 3
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
148 elseif prevs =~ '^\s*)'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
149 let m = 1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
150 elseif prevs =~ s:NC.'\%(<=.*\)\@<!;'.s:ES || (curs !~ '^\s*)' && prevs =~ s:NC.'=>.*'.s:NC.')'.s:ES)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
151 let m = 2
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
152 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
153
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
154 if m > 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
155 let pn = prevnonblank(prevn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
156 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
157 while pn > 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
158 let t = indent(pn)
2282
a888ed7ba375 Make updating text for conceal mode simpler. A few compiler warning fixes.
Bram Moolenaar <bram@vim.org>
parents: 1619
diff changeset
159 if ps !~ '^\s*--' && (t < ind || (t == ind && m == 3))
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
160 " make sure one of these is true
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
161 " keywords: variable + "<=" without ";" ending
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
162 " where: start of previous non-comment line
3153
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
163 " keywords: "procedure", "generic", "map", "port"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
164 " where: anywhere in previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
165 " keyword: "("
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
166 " where: start of previous non-comment line
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
167 if m < 3 && ps !~? '^\s*\S\+\s*<=[^;]*'.s:ES
3153
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
168 if ps =~? s:NC.'\<\%(procedure\|generic\|map\|port\)\>' || ps =~ '^\s*('
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
169 let ind = t
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
170 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
171 break
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
172 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
173 let ind = t
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
174 if m > 1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
175 " find following previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
176 let ppn = prevnonblank(pn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
177 let pps = getline(ppn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
178 while ppn > 0 && pps =~ '^\s*--'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
179 let ppn = prevnonblank(ppn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
180 let pps = getline(ppn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
181 endwhile
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
182 " indent: follow
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
183 " keyword: "select"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
184 " where: end of following previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
185 " keyword: "type"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
186 " where: start of following previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
187 if m == 2
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
188 let s1 = s:NC.'\<select'.s:ES
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
189 if ps !~? s1 && pps =~? s1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
190 let ind = indent(ppn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
191 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
192 elseif m == 3
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
193 let s1 = '^\s*type\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
194 if ps !~? s1 && pps =~? s1
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
195 let ind = indent(ppn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
196 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
197 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
198 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
199 break
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
200 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
201 let pn = prevnonblank(pn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
202 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
203 endwhile
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
204 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
205
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
206 " indent: follow indent of previous opening statement, otherwise -sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
207 " keyword: "begin"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
208 " where: anywhere in current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
209 if curs =~? s:NC.'\<begin\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
210 " find previous opening statement of
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
211 " keywords: "architecture", "block", "entity", "function", "generate", "procedure", "process"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
212 let s2 = s:NC.s:NE.'\<\%(architecture\|block\|entity\|function\|generate\|procedure\|process\)\>'
3153
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
213
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
214 let pn = prevnonblank(curn - 1)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
215 let ps = getline(pn)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
216 while pn > 0 && (ps =~ '^\s*--' || ps !~? s2)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
217 let pn = prevnonblank(pn - 1)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
218 let ps = getline(pn)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
219
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
220 if (ps =~? s:NC.'\<begin\>')
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
221 return indent(pn) - &sw
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
222 endif
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
223 endwhile
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
224
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
225 if (pn == 0)
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
226 return ind - &sw
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
227 else
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
228 return indent(pn)
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
229 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
230 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
231
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
232 " indent: +sw if previous line is previous opening statement
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
233 " keywords: "record", "units"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
234 " where: anywhere in current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
235 if curs =~? s:NC.s:NE.'\<\%(record\|units\)\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
236 " find previous opening statement of
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
237 " keyword: "type"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
238 let s3 = s:NC.s:NE.'\<type\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
239 if curs !~? s3.'.*'.s:NC.'\<\%(record\|units\)\>.*'.s:ES && prevs =~? s3
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
240 let ind = ind + &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
241 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
242 return ind
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
243 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
244
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
245 " ****************************************************************************************
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
246 " indent: 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
247 " keywords: "architecture", "configuration", "entity", "library", "package"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
248 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
249 if curs =~? '^\s*\%(architecture\|configuration\|entity\|library\|package\)\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
250 return 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
251 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
252
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
253 " indent: maintain indent of previous opening statement
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
254 " keyword: "is"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
255 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
256 " find previous opening statement of
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
257 " keywords: "architecture", "block", "configuration", "entity", "function", "package", "procedure", "process", "type"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
258 if curs =~? '^\s*\<is\>' && prevs =~? s:NC.s:NE.'\<\%(architecture\|block\|configuration\|entity\|function\|package\|procedure\|process\|type\)\>'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
259 return ind2
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
260 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
261
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
262 " indent: maintain indent of previous opening statement
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
263 " keyword: "then"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
264 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
265 " find previous opening statement of
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
266 " keywords: "elsif", "if"
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
267 if curs =~? '^\s*\<then\>' && prevs =~? s:NC.'\%(\<elsif\>\|'.s:NE.'\<if\>\)'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
268 return ind2
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
269 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
270
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
271 " indent: maintain indent of previous opening statement
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
272 " keyword: "generate"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
273 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
274 " find previous opening statement of
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
275 " keywords: "for", "if"
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
276 if curs =~? '^\s*\<generate\>' && prevs =~? s:NC.s:NE.'\%(\%(\<wait\s\+\)\@<!\<for\|\<if\)\>'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
277 return ind2
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
278 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
279
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
280 " indent: +sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
281 " keywords: "block", "process"
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
282 " removed: "begin", "case", "elsif", "if", "loop", "record", "units", "while"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
283 " where: anywhere in previous line
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
284 if prevs =~? s:NC.s:NE.'\<\%(block\|process\)\>'
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
285 return ind + &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
286 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
287
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
288 " indent: +sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
289 " keywords: "architecture", "configuration", "entity", "package"
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
290 " removed: "component", "for", "when", "with"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
291 " where: start of previous line
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
292 if prevs =~? '^\s*\%(architecture\|configuration\|entity\|package\)\>'
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
293 return ind + &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
294 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
295
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
296 " indent: +sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
297 " keyword: "select"
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
298 " removed: "generate", "is", "=>"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
299 " where: end of previous line
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
300 if prevs =~? s:NC.'\<select'.s:ES
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
301 return ind + &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
302 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
303
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
304 " indent: +sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
305 " keyword: "begin", "loop", "record", "units"
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
306 " where: anywhere in previous line
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
307 " keyword: "component", "else", "for"
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
308 " where: start of previous line
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
309 " keyword: "generate", "is", "then", "=>"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
310 " where: end of previous line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
311 " _note_: indent allowed to leave this filter
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
312 if prevs =~? s:NC.'\%(\<begin\>\|'.s:NE.'\<\%(loop\|record\|units\)\>\)' || prevs =~? '^\s*\%(component\|else\|for\)\>' || prevs =~? s:NC.'\%('.s:NE.'\<generate\|\<\%(is\|then\)\|=>\)'.s:ES
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
313 let ind = ind + &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
314 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
315
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
316 " ****************************************************************************************
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
317 " indent: -sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
318 " keywords: "when", provided previous line does not begin with "when", does not end with "is"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
319 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
320 let s4 = '^\s*when\>'
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
321 if curs =~? s4
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
322 if prevs =~? s:NC.'\<is'.s:ES
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
323 return ind
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
324 elseif prevs !~? s4
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
325 return ind - &sw
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
326 else
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
327 return ind2
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
328 endif
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
329 endif
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
330
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
331 " indent: -sw
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
332 " keywords: "else", "elsif", "end" + "block", "for", "function", "generate", "if", "loop", "procedure", "process", "record", "units"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
333 " where: start of current line
3153
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
334 let s5 = 'block\|for\|function\|generate\|if\|loop\|procedure\|process\|record\|units'
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
335 if curs =~? '^\s*\%(else\|elsif\|end\s\+\%('.s5.'\)\)\>'
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
336 if prevs =~? '^\s*\%(elsif\|'.s5.'\)'
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
337 return ind
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
338 else
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
339 return ind - &sw
37ecb8ff4560 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2296
diff changeset
340 endif
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
341 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
342
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
343 " indent: backtrace previous non-comment lines
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
344 " keyword: "end" + "case", "component"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
345 " where: start of current line
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
346 let m = 0
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
347 if curs =~? '^\s*end\s\+case\>'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
348 let m = 1
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
349 elseif curs =~? '^\s*end\s\+component\>'
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
350 let m = 2
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
351 endif
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
352
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
353 if m > 0
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
354 " find following previous non-comment line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
355 let pn = prevn
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
356 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
357 while pn > 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
358 if ps !~ '^\s*--'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
359 "indent: -2sw
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
360 "keywords: "end" + "case"
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
361 "where: start of previous non-comment line
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
362 "indent: -sw
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
363 "keywords: "when"
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
364 "where: start of previous non-comment line
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
365 "indent: follow
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
366 "keywords: "case"
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
367 "where: start of previous non-comment line
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
368 if m == 1
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
369 if ps =~? '^\s*end\s\+case\>'
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
370 return indent(pn) - 2 * &sw
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
371 elseif ps =~? '^\s*when\>'
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
372 return indent(pn) - &sw
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
373 elseif ps =~? '^\s*case\>'
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
374 return indent(pn)
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
375 endif
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
376 "indent: follow
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
377 "keyword: "component"
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
378 "where: start of previous non-comment line
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
379 elseif m == 2
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
380 if ps =~? '^\s*component\>'
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
381 return indent(pn)
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
382 endif
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
383 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
384 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
385 let pn = prevnonblank(pn - 1)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
386 let ps = getline(pn)
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
387 endwhile
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
388 return ind - &sw
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
389 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
390
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
391 " indent: -sw
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
392 " keyword: ")"
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
393 " where: start of current line
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
394 if curs =~ '^\s*)'
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
395 return ind - &sw
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
396 endif
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
397
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
398 " indent: 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
399 " keywords: "end" + "architecture", "configuration", "entity", "package"
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
400 " where: start of current line
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
401 if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>'
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
402 return 0
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
403 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
404
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
405 " indent: -sw
2296
eb7be7b075a6 Support :browse for commands that use an error file argument. (Lech Lorens)
Bram Moolenaar <bram@vim.org>
parents: 2282
diff changeset
406 " keywords: "end" + identifier, ";"
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
407 " where: start of current line
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 829
diff changeset
408 "if curs =~? '^\s*end\s\+\w\+\>'
2296
eb7be7b075a6 Support :browse for commands that use an error file argument. (Lech Lorens)
Bram Moolenaar <bram@vim.org>
parents: 2282
diff changeset
409 if curs =~? '^\s*end\%(\s\|;'.s:ES.'\)'
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
410 return ind - &sw
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
411 endif
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
412
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
413 " ****************************************************************************************
648
9032e4668296 updated for version 7.0189
vimboss
parents: 646
diff changeset
414 " indent: maintain indent of previous opening statement
9227
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
415 " keywords: without "procedure", "generic", "map", "port" + ":" but not ":=" + eventually ;$
649
8157079cea85 updated for version 7.0191
vimboss
parents: 648
diff changeset
416 " where: start of current line
9227
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
417 if curs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@<!\w\+\s*\w*\s*:[^=].*;.*$'
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
418 return ind2
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
419 endif
9227
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
420 " ****************************************************************************************
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
421 " indent: maintain indent of previous opening statement, corner case which
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
422 " does not end in ;, but is part of a mapping
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
423 " keywords: without "procedure", "generic", "map", "port" + ":" but not ":=", never + ;$ and
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
424 " prevline without "procedure", "generic", "map", "port" + ":" but not ":=" + eventually ;$
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
425 " where: start of current line
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
426 if curs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@<!\w\+\s*\w*\s*:[^=].*[^;].*$'
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
427 if prevs =~? '^\s*\%(\<\%(procedure\|generic\|map\|port\)\>.*\)\@<!\w\+\s*\w*\s*:[^=].*;.*$'
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
428 return ind2
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
429 endif
ecb621205ed1 commit https://github.com/vim/vim/commit/82af8710bf8d1caeeceafb1370a052cb7d92f076
Christian Brabandt <cb@256bit.org>
parents: 3153
diff changeset
430 endif
646
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
431
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
432 " return leftover filtered indent
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
433 return ind
eeda7c3124c5 updated for version 7.0188
vimboss
parents:
diff changeset
434 endfunction