Mercurial > vim
comparison runtime/indent/tcl.vim @ 856:8cd729851562 v7.0g
updated for version 7.0g
author | vimboss |
---|---|
date | Sun, 30 Apr 2006 18:54:39 +0000 |
parents | 1f3b1021f002 |
children | 8906c10ecbb0 |
comparison
equal
deleted
inserted
replaced
855:d2a4f08396fe | 856:8cd729851562 |
---|---|
34 let pattern = '[{}]' | 34 let pattern = '[{}]' |
35 let i = match(line, pattern) | 35 let i = match(line, pattern) |
36 while i != -1 | 36 while i != -1 |
37 if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'tcl\%(Comment\|String\)' | 37 if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'tcl\%(Comment\|String\)' |
38 if line[i] == '{' | 38 if line[i] == '{' |
39 let n_open += 1 | 39 let n_open += 1 |
40 elseif line[i] == '}' | 40 elseif line[i] == '}' |
41 if n_open > 0 | 41 if n_open > 0 |
42 let n_open -= 1 | 42 let n_open -= 1 |
43 else | 43 else |
44 let n_close += 1 | 44 let n_close += 1 |
45 endif | 45 endif |
46 endif | 46 endif |
47 endif | 47 endif |
48 let i = match(line, pattern, i + 1) | 48 let i = match(line, pattern, i + 1) |
49 endwhile | 49 endwhile |
50 return a:count_open ? n_open : n_close | 50 return a:count_open ? n_open : n_close |