Lines Matching +refs:indent +refs:line +refs:function
1 " Vim indent file
5 " TODO: how about nested [()]'s in one line
8 " Only load this indent file when no other was loaded.
13 runtime! indent/sh.vim " will set b:did_indent
19 " Only define the function once.
24 " get the offset (indent) of the end of the match of 'regexp' in 'line'
25 function s:GetOffsetOf(line, regexp)
26 let end = matchend(a:line, a:regexp)
30 if a:line[i] != "\t"
40 function GetConfigIndent()
41 " Find a non-blank line above the current line.
44 " Hit the start of the file, use zero indent.
51 let line = getline(lnum)
53 " if previous line has unmatched, unescaped opening parentheses,
54 " indent to its position. TODO: not failsafe if multiple ('s
55 if line =~ '\\\@<!([^)]*$'
56 let ind = s:GetOffsetOf(line, '\\\@!(')
59 " if previous line has unmatched opening bracket,
60 " indent to its position. TODO: same as above
61 if line =~ '\[[^]]*$'
62 let ind = s:GetOffsetOf(line, '\[')
65 " if previous line had an unmatched closing parantheses,
66 " indent to the matching opening parantheses
67 if line =~ '[^(]\+\\\@<!)$'
70 let ind = indent(lnum)
73 " if previous line had an unmatched closing bracket,
74 " indent to the matching opening bracket
75 if line =~ '[^[]\+]$'
78 let ind = indent(lnum)