Lines Matching refs:line

89 " A line ends with zero or more spaces, possibly followed by a comment.
94 " Returns 1 if (0-based) position immediately preceding `pos` in `line` is
102 " line and cannot contain escaped quotes.
103 function! s:CommentOrString(line, pos) argument
105 let q = stridx(a:line, '"')
106 let c = stridx(a:line, '%')
110 let c = stridx(a:line, '%', q + 1)
116 let q = stridx(a:line, '"', q + 1) " Find next quote
121 " Find the first non-comment non-blank line before the current line.
130 " Returns true if the last tag appearing in the line is an open tag; returns
132 function! s:LastTagIsOpen(line) argument
133 let o = s:LastValidMatchEnd(a:line, g:mp_open_tag, 0)
135 return s:LastValidMatchEnd(a:line, g:mp_close_tag, o) < 0
139 " a line should cause the next line to be indented: count the "opening tags"
140 " (if, for, def, ...) in the line, count the "closing tags" (endif, endfor,
141 " ...) in the line, and compute the difference. We call the result the
142 " "weight" of the line. If the weight is positive, then the next line should
146 " a closing tag (so that, for instance, a line containing a single `else:`
155 " % This line will be indented because |{forsuffixes,if,else}| > |{else,fi}| (3 > 2)
158 function! s:Weight(line) argument
159 let [o, i] = [0, s:ValidMatchEnd(a:line, g:mp_open_tag, 0)]
162 let i = s:ValidMatchEnd(a:line, g:mp_open_tag, i)
164 let [c, i] = [0, matchend(a:line, '^\s*\<else\%[if]\>')] " Skip a leading else[if]
165 let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
168 let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
174 " line: a String
175 function! s:ValidMatchEnd(line, pat, start) argument
176 let i = matchend(a:line, a:pat, a:start)
177 while i > 0 && s:CommentOrString(a:line, i)
178 let i = matchend(a:line, a:pat, i)
185 function! s:LastValidMatchEnd(line, pat, start) argument
187 let i = matchend(a:line, a:pat, a:start)
189 if !s:CommentOrString(a:line, i)
192 let i = matchend(a:line, a:pat, i)
213 " (e.g., '%>>' will cause the next line to be indented twice).
248 " This is the reference line relative to which the current line is indented
278 " If the reference line ends with an open tag, indent.
286 " fi if c2: % Note that this line has weight equal to zero.
287 " ... % This line will be indented
297 " ... % This line will be indented (because of the unterminated `for`)
307 " withcolor black; % This line is indented because of `draw`.
309 " + d + e; % This line is indented because of `:=`.
312 if i >= 0 " Does the line contain a statement?
321 " current reference line L ends with a semicolon, search backwards for
323 " its line is used as the reference line for indenting the current line
333 " for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...`