Mercurial > vim
comparison runtime/indent/config.vim @ 809:4f1b94b51e99 v7.0b02
updated for version 7.0b02
author | vimboss |
---|---|
date | Sun, 26 Mar 2006 21:06:50 +0000 |
parents | 4fe8e1a7758e |
children | 1f3b1021f002 |
comparison
equal
deleted
inserted
replaced
808:111e109dad13 | 809:4f1b94b51e99 |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Language: Autoconf configure.{ac,in} file | 2 " Language: Autoconf configure.{ac,in} file |
3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se> | 3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se> |
4 " Latest Revision: 2005-06-30 | 4 " Latest Revision: 2006-02-11 |
5 " TODO: how about nested [()]'s in one line | 5 " TODO: how about nested [()]'s in one line |
6 " what's wrong with '\\\@!'? | 6 " what's wrong with '\\\@!'? |
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") |
61 let ind = s:GetOffsetOf(line, '\[') | 61 let ind = s:GetOffsetOf(line, '\[') |
62 endif | 62 endif |
63 | 63 |
64 " if previous line had an unmatched closing parantheses, | 64 " if previous line had an unmatched closing parantheses, |
65 " indent to the matching opening parantheses | 65 " indent to the matching opening parantheses |
66 if line =~ '[^(]*\\\@<!)$' | 66 if line =~ '[^(]\+\\\@<!)$' |
67 call search(')', 'bW') | 67 call search(')', 'bW') |
68 let lnum = searchpair('\\\@<!(', '', ')', 'bWn') | 68 let lnum = searchpair('\\\@<!(', '', ')', 'bWn') |
69 let ind = indent(lnum) | 69 let ind = indent(lnum) |
70 endif | 70 endif |
71 | 71 |
72 " if previous line had an unmatched closing bracket, | 72 " if previous line had an unmatched closing bracket, |
73 " indent to the matching opening bracket | 73 " indent to the matching opening bracket |
74 if line =~ '[^[]*]$' | 74 if line =~ '[^[]\+]$' |
75 call search(']', 'bW') | 75 call search(']', 'bW') |
76 let lnum = searchpair('\[', '', ']', 'bWn') | 76 let lnum = searchpair('\[', '', ']', 'bWn') |
77 let ind = indent(lnum) | 77 let ind = indent(lnum) |
78 endif | 78 endif |
79 | 79 |
80 return ind | 80 return ind |
81 endfunction | 81 endfunction |
82 | |
83 " vim: set sts=2 sw=2: |