Commits

Audrius Kažukauskas committed 674cb13

Revert most of Python folding tweaks, too slow on >1kLOC files.

Comments (0)

Files changed (1)

ftplugin/python/python_fold.vim

 let w:nestinglevel = 0
 
 function! GetPythonFold(lnum)   " {{{
-  " Skip lines that begin with strings to avoid folding code examples inside
-  " docstrings.
-  if synIDattr(synID(a:lnum, 1, 0), 'name') =~? 'string' &&
-        \ synIDattr(synID(a:lnum + 1, 1, 0), 'name') =~? 'string'
-    return "="
-  endif
-
   let nnum = nextnonblank(a:lnum + 1)
   let nind = indent(nnum)
   let ind = indent(a:lnum)
     return ">" . ((w:nestinglevel + &sw) / &sw)
   endif
 
-  " Skip lines that begin with strings (unindented multiline strings, e.g. SQL
-  " queries) or comments (may be used for code markers).
-  if synIDattr(synID(nnum, 1, 0), 'name') !~? 'string\|comment'
-    " If next line has less or equal indentation than the first one, we end a
-    " fold.
-    if nind <= w:nestinglevel || (ind == w:nestinglevel + &sw && nind < ind)
-      let w:nestinglevel = nind
-      return "<" . ((w:nestinglevel + &sw) / &sw)
-    endif
+  " If next line has less or equal indentation than the first one, we end a
+  " fold.
+  if nind <= w:nestinglevel || (ind == w:nestinglevel + &sw && nind < ind)
+    let w:nestinglevel = nind
+    return "<" . ((w:nestinglevel + &sw) / &sw)
   endif
 
   " If none of the above apply, keep the indentation.