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

Alt + Return runs the cell in the currently opened file instead of the last cell #23076

Closed
positr0nium opened this issue Nov 25, 2024 · 3 comments · Fixed by #23505
Closed

Alt + Return runs the cell in the currently opened file instead of the last cell #23076

positr0nium opened this issue Nov 25, 2024 · 3 comments · Fixed by #23505
Assignees
Milestone

Comments

@positr0nium
Copy link

Problem Description

When debugging you often run a cell, that imports code from a module that you are modifying, i.e. file A imports file B and file B potentially contains a bug that needs to be fixed. When pressing alt+return, previously the last cell from file A was executed, even if file B is open in the editor. This seems to have changed. Now alt+return tries to find the cell in file B (which in many cases doesn't exist).

What steps reproduce the problem?

  1. Create two files, where one imports the other.
  2. Run a cell in the first file.
  3. Switch to the second file and hit alt+return

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

The expected output is the output from file A. Instead I see:

%runcell -i 238 Path/To/File/B.py
This command failed to be executed because an error occurred while trying to get the cell code from Spyder's editor.The error was:


An exception has occurred, use %tb to see the full traceback.

RuntimeError: Cell 238 not found.
@positr0nium
Copy link
Author

🙏

@ccordoba12
Copy link
Member

ccordoba12 commented Jan 18, 2025

Hey @positr0nium, thanks for reporting and sorry for the late response. I was able to easily reproduce this problem following your instructions above (thanks for them!).

We'll fix it in our next version (6.0.4), to be released in a few weeks.

@positr0nium
Copy link
Author

Thanks :)

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.

2 participants