Skip to content
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

Bug at code folding of code cells #14730

Closed
jbund256 opened this issue Feb 10, 2021 · 3 comments · Fixed by spyder-ide/pyls-spyder#18
Closed

Bug at code folding of code cells #14730

jbund256 opened this issue Feb 10, 2021 · 3 comments · Fixed by spyder-ide/pyls-spyder#18

Comments

@jbund256
Copy link

Problem Description

When I fold cole cells or subcells, the initator line, i.e. the line beginning with # %%, of the next code cell is folded as well. Thus the title of the next code cell is vanished.

What steps reproduce the problem?

  1. Open a python file in Spyder
  2. Create two code cells with # %% title
  3. Fold the first code cell.
# %% Title 1

a = 1
b = 2

# %% Title 2

What is the expected output? What do you see instead?

I see that the title of the second code cell is vanished. I would expect that the title of the second code cell does not vanish. Ideally, if there is a blank line before the second code cell, after folding the first code cell the blank line should remain there and should not be folded (for better readability).

Versions

  • Spyder version: 4.2.1
  • Python version: 3.8.5
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10 Pro/ Version 20H2
@dalthviz
Copy link
Member

Hi @jbund256 thanks for the feedback! I was able to reproduce this 👍

foldecell

Pinging @andfoy and @ccordoba12 just in case

@remisalmon
Copy link
Contributor

The code folding of cells was introduced in spyder-ide/pyls-spyder#15

I have just pushed a fix at spyder-ide/pyls-spyder#18

@ccordoba12 ccordoba12 added this to the v4.2.2 milestone Feb 13, 2021
@ccordoba12 ccordoba12 self-assigned this Feb 13, 2021
@ccordoba12
Copy link
Member

Thanks a lot for your help @remisalmon! I tested your fix manually and it's working as expected.

This will be part of our next version (4.2.2), to be released in a week.

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

Successfully merging a pull request may close this issue.

4 participants