Skip to content

Commit 03decbb

Browse files
authored
Merge pull request #23955 from ccordoba12/issue-23716
PR: Update focused file for Run plugin after a `Save as` operation (Editor)
2 parents 2bf4d7f + bd22d5c commit 03decbb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

spyder/app/tests/test_mainwindow.py

+4
Original file line numberDiff line numberDiff line change
@@ -4822,6 +4822,10 @@ def test_tour_message(main_window, qtbot):
48224822
sys.version_info[:2] < (3, 10),
48234823
reason="Too flaky in old Python versions"
48244824
)
4825+
@pytest.mark.skipif(
4826+
not running_in_ci_with_conda(),
4827+
reason="Too flaky with pip packages"
4828+
)
48254829
@pytest.mark.known_leak
48264830
def test_update_outline(main_window, qtbot, tmpdir):
48274831
"""

spyder/plugins/editor/widgets/main_widget.py

+6
Original file line numberDiff line numberDiff line change
@@ -2464,6 +2464,12 @@ def save_as(self):
24642464
fname = editorstack.get_current_filename()
24652465
self.__add_recent_file(fname)
24662466

2467+
# We need to call this directly because at least on Windows
2468+
# editorstack.editor_focus_changed is not emitted after saving the
2469+
# file (and it's not harmful to do it for other OSes).
2470+
# Fixes spyder-ide/spyder#23716
2471+
self.update_run_focus_file()
2472+
24672473
@Slot()
24682474
def save_copy_as(self):
24692475
"""Save *copy as* the currently edited file"""

0 commit comments

Comments
 (0)