Lines Matching refs:line
40 let line = substitute(getline(a:lnum), '//.*$', '', '')
41 let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g')
42 return line
45 function! scala#CountBrackets(line, openBracket, closedBracket) argument
46 let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g')
47 let open = substitute(line, '[^' . a:openBracket . ']', '', 'g')
48 let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g')
52 function! scala#CountParens(line) argument
53 return scala#CountBrackets(a:line, '(', ')')
56 function! scala#CountCurlies(line) argument
57 return scala#CountBrackets(a:line, '{', '}')
60 function! scala#LineEndsInIncomplete(line) argument
61 if a:line =~ '[.,]\s*$'
68 function! scala#LineIsAClosingXML(line) argument
69 if a:line =~ '^\s*</\w'
76 function! scala#LineCompletesXML(lnum, line) argument
79 let tag = substitute(a:line, '^.*</\([^>]*\)>.*$', '\1', '')
111 let line = scala#GetLine(lnum)
112 if line =~ '^\s*' . s:defMatcher
132 let curline = scala#GetLine(line('.'))
158 function! scala#NumberOfBraceGroups(line) argument
159 let line = substitute(a:line, '[^()]', '', 'g')
160 if strlen(line) == 0
163 let line = substitute(line, '^)*', '', 'g')
164 if strlen(line) == 0
167 let line = substitute(line, '^(', '', 'g')
168 if strlen(line) == 0
174 while counter < strlen(line)
175 let char = strpart(line, counter, 1)
189 function! scala#MatchesIncompleteDefValr(line) argument
190 if a:line =~ '^\s*\%(' . s:defMatcher . '\|' . s:valMatcher . '\).*[=({]\s*$'
197 function! scala#LineIsCompleteIf(line) argument
198 if scala#CountBrackets(a:line, '{', '}') == 0 &&
199 \ scala#CountBrackets(a:line, '(', ')') == 0 &&
200 \ a:line =~ '^\s*\<if\>\s*([^)]*)\s*\S.*$'
207 function! scala#LineCompletesIfElse(lnum, line) argument
208 if a:line =~ '^\s*\%(\<if\>\|\%(}\s*\)\?\<else\>\)'
231 function! scala#Testhelper(lnum, line, openBracket, closedBracket, iteration) argument
232 let bracketCount = scala#CountBrackets(a:line, a:openBracket, a:closedBracket)
233 " There are more '}' braces than '{' on this line so it may be completing the function definition
258 …" There's an equal number of '{' and '}' on this line so it may be a single line function definiti…
262 … return scala#Testhelper(a:lnum, a:line, otherBracketType[0], otherBracketType[1], a:iteration + 1)
269 let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line)
288 function! scala#Test(lnum, line, openBracket, closedBracket) argument
289 return scala#Testhelper(a:lnum, a:line, a:openBracket, a:closedBracket, 0)
292 function! scala#LineCompletesDefValr(lnum, line) argument
293 let bracketCount = scala#CountBrackets(a:line, '{', '}')
307 let bracketCount = scala#CountBrackets(a:line, '(', ')')
325 let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line)
372 " Find a non-blank line above the current line.
403 " If this line starts with a { then make it indent the same as the previous line
436 " If 'if', 'for' or 'while' end with ), this is a one-line block
437 " If 'val', 'var', 'def' end with =, this is a one-line block
457 " have to indent to line that started the whole thing
463 " definition, so we need to indent to that line instead. This is
485 " have to indent to line that started the whole thing
491 " definition, so we need to indent to that line instead. This is