comparison runtime/indent/vhdl.vim @ 39:c16898406ff2

synchorinize version 7.3.081
author one@zeus.cr.ie.u-ryukyu.ac.jp
date Fri, 17 Dec 2010 17:43:06 +0900
parents e170173ecb68
children 67300faee616
comparison
equal deleted inserted replaced
38:e06a1cd7230d 39:c16898406ff2
1 " VHDL indent ('93 syntax) 1 " VHDL indent ('93 syntax)
2 " Language: VHDL 2 " Language: VHDL
3 " Maintainer: Gerald Lai <laigera+vim?gmail.com> 3 " Maintainer: Gerald Lai <laigera+vim?gmail.com>
4 " Version: 1.54 4 " Version: 1.56
5 " Last Change: 2007 Aug 17 5 " Last Change: 2010 Jun 29
6 " URL: http://www.vim.org/scripts/script.php?script_id=1450 6 " URL: http://www.vim.org/scripts/script.php?script_id=1450
7 7
8 " only load this indent file when no other was loaded 8 " only load this indent file when no other was loaded
9 if exists("b:did_indent") 9 if exists("b:did_indent")
10 finish 10 finish
154 if m > 0 154 if m > 0
155 let pn = prevnonblank(prevn - 1) 155 let pn = prevnonblank(prevn - 1)
156 let ps = getline(pn) 156 let ps = getline(pn)
157 while pn > 0 157 while pn > 0
158 let t = indent(pn) 158 let t = indent(pn)
159 if ps !~ '^\s*--' && t < ind 159 if ps !~ '^\s*--' && (t < ind || (t == ind && m == 3))
160 " make sure one of these is true 160 " make sure one of these is true
161 " keywords: variable + "<=" without ";" ending 161 " keywords: variable + "<=" without ";" ending
162 " where: start of previous non-comment line 162 " where: start of previous non-comment line
163 " keywords: "generic", "map", "port" 163 " keywords: "generic", "map", "port"
164 " where: anywhere in previous non-comment line 164 " where: anywhere in previous non-comment line
384 if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>' 384 if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>'
385 return 0 385 return 0
386 endif 386 endif
387 387
388 " indent: -sw 388 " indent: -sw
389 " keywords: "end" + identifier 389 " keywords: "end" + identifier, ";"
390 " where: start of current line 390 " where: start of current line
391 "if curs =~? '^\s*end\s\+\w\+\>' 391 "if curs =~? '^\s*end\s\+\w\+\>'
392 if curs =~? '^\s*end\s' 392 if curs =~? '^\s*end\%(\s\|;'.s:ES.'\)'
393 return ind - &sw 393 return ind - &sw
394 endif 394 endif
395 395
396 " **************************************************************************************** 396 " ****************************************************************************************
397 " indent: maintain indent of previous opening statement 397 " indent: maintain indent of previous opening statement