Skip to content

Commit 96491ce

Browse files
committed
Modify foldtext for docstring folding
1 parent a3b3d91 commit 96491ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autoload/pymode/folding.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let s:doc_line_regex = '^\s*\("""\|''''''\).\+\1\s*$'
1111

1212
fun! pymode#folding#text() " {{{
1313
let fs = v:foldstart
14-
while getline(fs) =~ '^\s*@'
14+
while getline(fs) =~ '\%(^\s*@\)\|\%(^\s*\%("""\|''''''\)\s*$\)'
1515
let fs = nextnonblank(fs + 1)
1616
endwhile
1717
let line = getline(fs)
@@ -25,6 +25,7 @@ fun! pymode#folding#text() " {{{
2525
let line = substitute(line, '\t', onetab, 'g')
2626

2727
let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
28+
let line = substitute(line, '\%("""\|''''''\)', '', '')
2829
let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
2930
return line . '' . repeat(" ",fillcharcount) . foldedlinecount . '' . ' '
3031
endfunction "}}}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy