Skip to content

Commit a8d2b4a

Browse files
authored
Merge pull request python-mode#760 from ColinKennedy/add_raw_docstring_fold_support
Updated docstring regex to allow folding of raw python strings
2 parents 73620c4 + 8abc436 commit a8d2b4a

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)
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