Sublime Forum

Code folding python

#1

I have a problem with python code folding.
Consider these 2 functions:

[code]def foo(arg1,
arg2,
arg3):
call1()
call2()

def foobar(arg1, arg2, arg3):
call1()
call2()
[/code]

when folded they end up like this:

[code]def foo(arg1, …]
call1()
call2()

def foobar(arg1, arg2, arg3): …]
[/code]

As you can see having arguments on multiple lines is breaking the code folding.
Anyone know if this can be fixed by modifying a file somewhere?

Thanks

0 Likes

#2

Folding isn’t really syntax aware, it just uses some simplistic indentation heuristics.

I guess the only way you’ll have much luck is via writing a plugin.

0 Likes