File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ fun! pymode#folding#foldcase(lnum) "{{{
207207endfunction " }}}
208208
209209fun ! s: BlockStart (lnum) " {{{
210- " Returns the definition statement which encloses the current line.
210+ " Returns the definition statement line which encloses the current line.
211211
212212 let line = getline (a: lnum )
213213 if line !~ s: blank_regex
@@ -227,7 +227,11 @@ fun! s:BlockStart(lnum) "{{{
227227 " n: do Not move the cursor
228228 " W: don't Wrap around the end of the file
229229 let previous_definition = searchpos (s: def_regex , ' bnW' )
230- if previous_definition != [0 , 0 ]
230+
231+ " Corner case of function being defined on the first line.
232+ if previous_definition[0 ] == 1
233+ " Just skip the while loop.
234+ elseif previous_definition != [0 , 0 ]
231235 " Lines that are blank have zero indent.
232236 while previous_definition != [0 , 0 ]
233237 \ && indent (previous_definition[0 ]) >= l: inferred_indent
You can’t perform that action at this time.
0 commit comments