Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RegEx expansion to match Python function definitions #150

Open
ntropia2 opened this issue Dec 18, 2024 · 0 comments
Open

RegEx expansion to match Python function definitions #150

ntropia2 opened this issue Dec 18, 2024 · 0 comments

Comments

@ntropia2
Copy link

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?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant