From 8abc4363b0e6f073a9bc29af17752ea72a8cdf92 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Thu, 18 May 2017 13:29:00 -0800 Subject: [PATCH] Updated docstring regex to allow folding of raw python strings --- autoload/pymode/folding.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/pymode/folding.vim b/autoload/pymode/folding.vim index 399748e3..3b29aebb 100644 --- a/autoload/pymode/folding.vim +++ b/autoload/pymode/folding.vim @@ -9,12 +9,12 @@ let s:blank_regex = '^\s*$' " Spyder, a very popular IDE for python has a template which includes " '@author:' ; thus the regex below. let s:decorator_regex = '^\s*@\(author:\)\@!' -let s:doc_begin_regex = '^\s*[uU]\=\%("""\|''''''\)' +let s:doc_begin_regex = '^\s*[uUrR]\=\%("""\|''''''\)' let s:doc_end_regex = '\%("""\|''''''\)\s*$' " This one is needed for the while loop to count for opening and closing " docstrings. let s:doc_general_regex = '\%("""\|''''''\)' -let s:doc_line_regex = '^\s*[uU]\=\("""\|''''''\).\+\1\s*$' +let s:doc_line_regex = '^\s*[uUrR]\=\("""\|''''''\).\+\1\s*$' let s:symbol = matchstr(&fillchars, 'fold:\zs.') " handles multibyte characters if s:symbol == '' let s:symbol = ' ' @@ -42,7 +42,7 @@ fun! pymode#folding#text() " {{{ let line = substitute(line, '\t', onetab, 'g') let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) - let line = substitute(line, '[uU]\=\%("""\|''''''\)', '', '') + let line = substitute(line, '[uUrR]\=\%("""\|''''''\)', '', '') let fillcharcount = windowwidth - len(line) - len(foldedlinecount) + 1 return line . ' ' . repeat(s:symbol, fillcharcount) . ' ' . foldedlinecount endfunction "}}} 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