From fa4f3f844de1c41a47d635bdd320fcb71d10abaf Mon Sep 17 00:00:00 2001 From: dalthviz <16781833+dalthviz@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:25:00 -0500 Subject: [PATCH] More fixes for mainwindow tests --- spyder/app/tests/test_mainwindow.py | 2 +- spyder/plugins/editor/plugin.py | 6 ++++++ spyder/plugins/editor/widgets/main_widget.py | 11 ++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index 740d351a1c4..86fe4d77429 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -5636,7 +5636,7 @@ def test_debug_unsaved_function(main_window, qtbot): run_parameters = generate_run_parameters(main_window, fname) CONF.set('run', 'last_used_parameters', run_parameters) - main_window.editor.update_run_focus_file() + main_window.editor.get_widget().update_run_focus_file() qtbot.wait(2000) # Set breakpoint diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py index 4fa3eab7b34..abb0fb733b0 100644 --- a/spyder/plugins/editor/plugin.py +++ b/spyder/plugins/editor/plugin.py @@ -797,6 +797,12 @@ def close_file_from_name(self, *args, **kwargs): def close_all_files(self): return self.get_widget().close_all_files() + def go_to_line(self, *args, **kwargs): + return self.get_widget().go_to_line(*args, **kwargs) + + def set_current_filename(self, *args, **kwargs): + return self.get_widget().set_current_filename(*args, **kwargs) + # ---- Private API # ------------------------------------------------------------------------ # ---- Run related methods diff --git a/spyder/plugins/editor/widgets/main_widget.py b/spyder/plugins/editor/widgets/main_widget.py index a2810432495..21fbe26cc8c 100644 --- a/spyder/plugins/editor/widgets/main_widget.py +++ b/spyder/plugins/editor/widgets/main_widget.py @@ -1487,12 +1487,13 @@ def update_source_menu(self, options, **kwargs): named_options = dict(zip(option_names, options)) for name, action in self.checkable_actions.items(): if name in named_options: - if name == 'underline_errors': + opt = named_options[name] + section = 'editor' + completions_options = ['pycodestyle', 'pydocstyle'] + if name in completions_options: section = 'completions' - opt = 'underline_errors' - else: - section = 'editor' - opt = named_options[name] + if name == 'underline_errors': + opt = name state = self.get_conf(opt, section=section)