From b0e637c44dd45e5787abffd314f6f46fb9a31a39 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Sun, 12 Feb 2023 10:23:08 +0100 Subject: [PATCH 1/4] GO TO NEXT/PREV --- spyder/config/main.py | 2 ++ .../ipythonconsole/widgets/main_widget.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/spyder/config/main.py b/spyder/config/main.py index 03350d028b5..501e1974bf2 100644 --- a/spyder/config/main.py +++ b/spyder/config/main.py @@ -513,6 +513,8 @@ 'ipython_console/clear line': "Shift+Escape", 'ipython_console/enter array inline': "Ctrl+Alt+M", 'ipython_console/enter array table': "Ctrl+M", + 'ipython_console/go to next console': "Ctrl+Alt+Right", + 'ipython_console/go to previous console': "Ctrl+Alt+Left", # ---- In widgets/arraybuider.py ---- 'array_builder/enter array inline': "Ctrl+Alt+M", 'array_builder/enter array table': "Ctrl+M", diff --git a/spyder/plugins/ipythonconsole/widgets/main_widget.py b/spyder/plugins/ipythonconsole/widgets/main_widget.py index 5e0142fb090..0c61487c8a8 100644 --- a/spyder/plugins/ipythonconsole/widgets/main_widget.py +++ b/spyder/plugins/ipythonconsole/widgets/main_widget.py @@ -90,6 +90,10 @@ class IPythonConsoleWidgetActions: ConsoleHelp = 'console help' QuickReference = 'quick reference' + # Navigation + GoRight = "go to next console" + GoLeft = "go to previous console" + class IPythonConsoleWidgetOptionsMenus: SpecialConsoles = 'special_consoles_submenu' @@ -408,6 +412,20 @@ def setup(self): triggered=self.tab_name_editor, ) + self.create_action( + IPythonConsoleWidgetActions.GoRight, + text=_("Go to the next console"), + icon=self.create_icon('Next'), + triggered=lambda: self.tabs.tab_navigate(+1), + register_shortcut=True + ) + self.create_action( + IPythonConsoleWidgetActions.GoLeft, + text=_("Go to the previous console"), + icon=self.create_icon('Previous'), + triggered=lambda: self.tabs.tab_navigate(-1), + register_shortcut=True + ) # --- For the client self.env_action = self.create_action( IPythonConsoleWidgetActions.ShowEnvironmentVariables, From f61c8ef9a120b687db8e179d7a21fab53ca56c56 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Sun, 12 Feb 2023 11:04:25 +0100 Subject: [PATCH 2/4] Fix number of shortcuts --- spyder/plugins/shortcuts/tests/test_shortcuts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spyder/plugins/shortcuts/tests/test_shortcuts.py b/spyder/plugins/shortcuts/tests/test_shortcuts.py index b2ca4b665f8..db12a29b443 100644 --- a/spyder/plugins/shortcuts/tests/test_shortcuts.py +++ b/spyder/plugins/shortcuts/tests/test_shortcuts.py @@ -121,9 +121,9 @@ def test_shortcut_filtering_context(shortcut_table): # Filter by "console" shortcut_table.finder = FilterTextMock('console') shortcut_table.set_regex() - # Verify the number of entries after the regex are 12 + # Verify the number of entries after the regex are 14 # If a new shortcut is added to console, this needs to be changed - assert shortcut_table.model().rowCount() == 12 + assert shortcut_table.model().rowCount() == 14 # Filter by "pylint" shortcut_table.finder = FilterTextMock('pylint') From a976ff62eecab841d1acfba7c0f9fe5f67ffd4de Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Tue, 14 Feb 2023 20:21:25 +0100 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Carlos Cordoba --- spyder/plugins/ipythonconsole/widgets/main_widget.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spyder/plugins/ipythonconsole/widgets/main_widget.py b/spyder/plugins/ipythonconsole/widgets/main_widget.py index 0c61487c8a8..8d812170f46 100644 --- a/spyder/plugins/ipythonconsole/widgets/main_widget.py +++ b/spyder/plugins/ipythonconsole/widgets/main_widget.py @@ -426,6 +426,7 @@ def setup(self): triggered=lambda: self.tabs.tab_navigate(-1), register_shortcut=True ) + # --- For the client self.env_action = self.create_action( IPythonConsoleWidgetActions.ShowEnvironmentVariables, From 844dc6de9f7596c9ec17ef667b42aa7eda36c7ef Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Wed, 21 Jun 2023 07:39:45 +0200 Subject: [PATCH 4/4] fix manifest --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 4b3fb2dce0e..1906ded6433 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include MANIFEST.in include README.md include LICENSE.txt include changelogs/Spyder-5.md +include changelogs/Spyder-6.md include AUTHORS.txt include NOTICE.txt include bootstrap.py