Skip to content

RegEx expansion to match Python function definitions #150

@ntropia2

Description

@ntropia2

I noticed that the plugin works with mixed results with Python code, capturing the class definition very well, but missing most of the function definitions (def ...).

I tried to extend the regular expressions with g:context_extend_regex but I couldn't get a clean behavior. This is the best I could come up with:

let g:context_extend_regex = '^\s*\([]{})]\|end\|else\|case\>\|default\>\|def\)' 

which matches decorated functions like this:

@property
def my_function():
       pass

but does not recognize anymore the end of the function from the indentation change.

Did anyone have luck at getting this to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions