atom / language-python

Python package for Atom
Other
190 stars 146 forks source link

Fix code folding for 'elif' and 'else' statements #292

Closed daviwil closed 5 years ago

daviwil commented 5 years ago

Description of the Change

This PR fixes #290 which reports that the Tree-Sitter Python grammar does not fold elif and else correctly. The fix is to update tree-sitter-python.cson to be a little more explicit about the nodes that cause if_statement folding to end.

Before

python_folding_broken

After

python_folding_fixed

Alternate Designs

None.

Benefits

elif and else blocks fold as expected.

Possible Drawbacks

None?

Applicable Issues

Fixes #290