10000 Don't fold single line def by Ram-Z · Pull Request #534 · python-mode/python-mode · GitHub
[go: up one dir, main page]

Skip to content

Don't fold single line def #534

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2015
Merged

Conversation

Ram-Z
Copy link
Contributor
@Ram-Z Ram-Z commented Feb 23, 2015

Simply checks whether the next line is more indented than the line
matching def_regex and if it's not don't increase the fold level.

Avoids an issue where

def rev(x): return reverse(x)
if something:
  def rev(x): return x

gets folded to

def rev(x): return reverse(x)

not showing the rest of the code.

Simply checks whether the next line is more indented than the line
matching def_regex and if it's not don't increase the fold level.
@Ram-Z
Copy link
Contributor Author
Ram-Z commented Feb 23, 2015

Come to think of it, this will still fold if the following line is empty, so probably another approach would be better.

klen added a commit that referenced this pull request Aug 26, 2015
@klen klen merged commit fb2ab53 into python-mode:develop Aug 26, 2015
@klen
Copy link
Collaborator
klen commented Aug 26, 2015

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants
0