# Improve code folding to exclude folding line breaks in whitespace-sensitive languages \(\#13108\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fefc91c6ad60eda7d6e775d19962634bbb9b57de)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fefc91c6ad60eda7d6e775d19962634bbb9b57de

Requested commit: fefc91c6ad60eda7d6e775d19962634bbb9b57de

Commit: fefc91c6ad60eda7d6e775d19962634bbb9b57de

Tree: 43955c7244519f8d3dcca233367bfbc0084f4197

Author: Nigel Jose

Committer: GitHub

## Message

```
Improve code folding to exclude folding line breaks in whitespace-sensitive languages (#13108)

<img width="1219" alt="Screenshot 2024-06-16 at 15 43 31"
src="https://github.com/zed-industries/zed/assets/87859239/dd05de16-7f20-4c88-9e95-021555b8b78b">
<img width="1219" alt="Screenshot 2024-06-16 at 15 45 10"
src="https://github.com/zed-industries/zed/assets/87859239/b1b78cdd-f34d-4ea3-9728-4741727a9643">

Updated the foldable_range method to exclude folding line breaks during
code folding in whitespace-sensitive languages like Python and YAML.
This adjustment ensures that folding behaves as expected, similar to
other code editors.

Ref #11614

Release Notes:

- Improved code folds to ignore trailing newlines


```

## Parents

- [3076567f6beea8b27637e3b5f5614838f18798e1](https://git.cafe/gitcafe/zed/commit/3076567f6beea8b27637e3b5f5614838f18798e1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fefc91c6ad60eda7d6e775d19962634bbb9b57de?format=markdown)
