Skip to content

Commit 8abc436

Browse files
committed
Updated docstring regex to allow folding of raw python strings
1 parent 73620c4 commit 8abc436

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/pymode/folding.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ let s:blank_regex = '^\s*$'
99
" Spyder, a very popular IDE for python has a template which includes
1010
" '@author:' ; thus the regex below.
1111
let s:decorator_regex = '^\s*@\(author:\)\@!'
12-
let s:doc_begin_regex = '^\s*[uU]\=\%("""\|''''''\)'
12+
let s:doc_begin_regex = '^\s*[uUrR]\=\%("""\|''''''\)'
1313
let s:doc_end_regex = '\%("""\|''''''\)\s*$'
1414
" This one is needed for the while loop to count for opening and closing
1515
" docstrings.
1616
let s:doc_general_regex = '\%("""\|''''''\)'
17-
let s:doc_line_regex = '^\s*[uU]\=\("""\|''''''\).\+\1\s*$'
17+
let s:doc_line_regex = '^\s*[uUrR]\=\("""\|''''''\).\+\1\s*$'
1818
let s:symbol = matchstr(&fillchars, 'fold:\zs.') " handles multibyte characters
1919
if s:symbol == ''
2020
let s:symbol = ' '
@@ -42,7 +42,7 @@ fun! pymode#folding#text() " {{{
4242
let line = substitute(line, '\t', onetab, 'g')
4343

4444
let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
45-
let line = substitute(line, '[uU]\=\%("""\|''''''\)', '', '')
45+
let line = substitute(line, '[uUrR]\=\%("""\|''''''\)', '', '')
4646
let fillcharcount = windowwidth - len(line) - len(foldedlinecount) + 1
4747
return line . ' ' . repeat(s:symbol, fillcharcount) . ' ' . foldedlinecount
4848
endfunction "}}}

0 commit comments

Comments
 (0)