From 947f57ace9d36660b443e81c23c4690803aefa1e Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Tue, 13 Aug 2019 12:27:35 +0100 Subject: [PATCH 01/10] Add history file to pdb history --- .../plugins/ipythonconsole/widgets/control.py | 23 +++++++++++++++++-- .../ipythonconsole/widgets/debugging.py | 8 ++++--- spyder/widgets/mixins.py | 1 + 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py index f29ec91838b..43673d1f37a 100644 --- a/spyder/plugins/ipythonconsole/widgets/control.py +++ b/spyder/plugins/ipythonconsole/widgets/control.py @@ -5,19 +5,23 @@ # (see spyder/__init__.py for details) """Control widgets used by ShellWidget""" +import os +import time from qtpy.QtCore import Qt, Signal from qtpy.QtWidgets import QTextEdit +from spyder.config.base import get_conf_path from spyder.utils.qthelpers import restore_keyevent from spyder.widgets.calltip import CallTipWidget from spyder.widgets.mixins import (BaseEditMixin, GetHelpMixin, TracebackLinksMixin, - BrowseHistoryMixin) + BrowseHistoryMixin, + SaveHistoryMixin) class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, - QTextEdit, BaseEditMixin): + QTextEdit, BaseEditMixin, SaveHistoryMixin): """ Subclass of QTextEdit with features from Spyder's mixins to use as the control widget for IPython widgets @@ -26,6 +30,9 @@ class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, visibility_changed = Signal(bool) go_to_error = Signal(str) focus_changed = Signal() + SEPARATOR = '{0}## ---({1})---'.format(os.linesep*2, time.ctime()) + INITHISTORY = ['# -*- coding: utf-8 -*-'] + PDB_HIST_MAX = 400 def __init__(self, parent=None): QTextEdit.__init__(self, parent) @@ -33,6 +40,18 @@ def __init__(self, parent=None): TracebackLinksMixin.__init__(self) GetHelpMixin.__init__(self) BrowseHistoryMixin.__init__(self) + history_filename = get_conf_path('pdb_history.py') + SaveHistoryMixin.__init__( + self, history_filename=history_filename) + with open(history_filename) as f: + lines = f.readlines() + for line in lines: + line = line.strip() + if line: + self.history.append(line) + # Remove old history + with open(history_filename, 'w') as f: + f.writelines(self.history[:self.PDB_HIST_MAX]) self.calltip_widget = CallTipWidget(self, hide_timer_on=False) self.found_results = [] diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index 23b0dea6379..ed76be44539 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -123,10 +123,12 @@ def callback(line): # Save history to browse it later if not (len(self._control.history) > 0 and self._control.history[-1] == line): - # do not save pdb commands + # Do not save pdb commands unless they have arguments cmd = line.split(" ")[0] - if cmd and "do_" + cmd not in dir(pdb.Pdb): - self._control.history.append(line) + args = line.split(" ")[1:] + is_pdb_cmd = "do_" + cmd in dir(pdb.Pdb) + if cmd and (not is_pdb_cmd or len(args) > 0): + self._control.add_to_history(line) # must match ConsoleWidget.do_execute self._executing = True diff --git a/spyder/widgets/mixins.py b/spyder/widgets/mixins.py index 6fed178cc58..a89d6f6320a 100644 --- a/spyder/widgets/mixins.py +++ b/spyder/widgets/mixins.py @@ -1356,6 +1356,7 @@ def browse_history(self, backward): tocursor = self.get_current_line_to_cursor() text, self.histidx = self.find_in_history(tocursor, self.histidx, backward) + text = text.strip() if text is not None: if self.hist_wholeline: self.clear_line() From faec3bf429df1f9a3ecb25f43d7d9c7ab78292a8 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Tue, 13 Aug 2019 16:09:59 +0100 Subject: [PATCH 02/10] fix_history --- spyder/widgets/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyder/widgets/mixins.py b/spyder/widgets/mixins.py index a89d6f6320a..8c133b62c30 100644 --- a/spyder/widgets/mixins.py +++ b/spyder/widgets/mixins.py @@ -1356,8 +1356,8 @@ def browse_history(self, backward): tocursor = self.get_current_line_to_cursor() text, self.histidx = self.find_in_history(tocursor, self.histidx, backward) - text = text.strip() if text is not None: + text = text.strip() if self.hist_wholeline: self.clear_line() self.insert_text(text) From ddb7d61aa0f1d0f4b66524b0b2fbccbbb4a3b4f0 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Tue, 13 Aug 2019 16:59:09 +0100 Subject: [PATCH 03/10] write line return when saving the file --- spyder/plugins/ipythonconsole/widgets/control.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py index 43673d1f37a..170ed2991e9 100644 --- a/spyder/plugins/ipythonconsole/widgets/control.py +++ b/spyder/plugins/ipythonconsole/widgets/control.py @@ -51,7 +51,9 @@ def __init__(self, parent=None): self.history.append(line) # Remove old history with open(history_filename, 'w') as f: - f.writelines(self.history[:self.PDB_HIST_MAX]) + for line in self.history[:self.PDB_HIST_MAX]: + f.write(line) + f.write('\n') self.calltip_widget = CallTipWidget(self, hide_timer_on=False) self.found_results = [] From 8bff573200d064fbf828be6f63c91f3c2454ae5d Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Wed, 14 Aug 2019 07:27:37 +0100 Subject: [PATCH 04/10] Save last genuine Pdb command for empty execution --- spyder/plugins/ipythonconsole/widgets/debugging.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index ed76be44539..d20b80ba262 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -35,6 +35,7 @@ def __init__(self, *args, **kwargs): self._previous_prompt = None self._input_queue = [] self._input_ready = False + self._last_pdb_cmd = '' def set_queued_input(self, client): """Change the kernel client input function queue calls.""" @@ -42,6 +43,9 @@ def set_queued_input(self, client): def queued_input(string): """If input is not ready, save it in a queue.""" + if not string.strip(): + # Must get the last genuine command + string = self._last_pdb_cmd if self._input_ready: self._input_ready = False return old_input(string) @@ -130,6 +134,10 @@ def callback(line): if cmd and (not is_pdb_cmd or len(args) > 0): self._control.add_to_history(line) + line = line.strip() + if line: + self._last_pdb_cmd = line + # must match ConsoleWidget.do_execute self._executing = True From 567839cf853f1e78aeb6373cefb151c7fe908a6f Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Wed, 14 Aug 2019 14:09:44 +0100 Subject: [PATCH 05/10] Use sqlite history --- .../plugins/ipythonconsole/widgets/control.py | 61 ++++++++++++------- .../ipythonconsole/widgets/debugging.py | 16 ++--- 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py index 170ed2991e9..8d8a158af38 100644 --- a/spyder/plugins/ipythonconsole/widgets/control.py +++ b/spyder/plugins/ipythonconsole/widgets/control.py @@ -5,23 +5,35 @@ # (see spyder/__init__.py for details) """Control widgets used by ShellWidget""" -import os -import time +import pdb from qtpy.QtCore import Qt, Signal from qtpy.QtWidgets import QTextEdit +from IPython.core.history import HistoryManager from spyder.config.base import get_conf_path from spyder.utils.qthelpers import restore_keyevent from spyder.widgets.calltip import CallTipWidget from spyder.widgets.mixins import (BaseEditMixin, GetHelpMixin, TracebackLinksMixin, - BrowseHistoryMixin, - SaveHistoryMixin) + BrowseHistoryMixin) + + +class PdbHistory(HistoryManager): + + def _get_hist_file_name(self, profile=None): + """ + Get default pdb history file name. + + The profile parameter is ignored, but must exist for compatibility with + the parent class. + """ + + return get_conf_path('pdb_history.sqlite') class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, - QTextEdit, BaseEditMixin, SaveHistoryMixin): + QTextEdit, BaseEditMixin): """ Subclass of QTextEdit with features from Spyder's mixins to use as the control widget for IPython widgets @@ -30,8 +42,6 @@ class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, visibility_changed = Signal(bool) go_to_error = Signal(str) focus_changed = Signal() - SEPARATOR = '{0}## ---({1})---'.format(os.linesep*2, time.ctime()) - INITHISTORY = ['# -*- coding: utf-8 -*-'] PDB_HIST_MAX = 400 def __init__(self, parent=None): @@ -40,20 +50,11 @@ def __init__(self, parent=None): TracebackLinksMixin.__init__(self) GetHelpMixin.__init__(self) BrowseHistoryMixin.__init__(self) - history_filename = get_conf_path('pdb_history.py') - SaveHistoryMixin.__init__( - self, history_filename=history_filename) - with open(history_filename) as f: - lines = f.readlines() - for line in lines: - line = line.strip() - if line: - self.history.append(line) - # Remove old history - with open(history_filename, 'w') as f: - for line in self.history[:self.PDB_HIST_MAX]: - f.write(line) - f.write('\n') + + self.pdb_history_file = PdbHistory() + self.history = [line[-1] + for line in self.pdb_history_file.get_tail( + self.PDB_HIST_MAX, include_latest=True)] self.calltip_widget = CallTipWidget(self, hide_timer_on=False) self.found_results = [] @@ -94,6 +95,24 @@ def focusOutEvent(self, event): self.focus_changed.emit() return super(ControlWidget, self).focusOutEvent(event) + def add_to_pdb_history(self, line_num, line): + """Add command to history""" + self.histidx = None + if not line: + return + line = line.strip() + + # If repeated line + if len(self.history) > 0 and self.history[-1] == line: + return + + cmd = line.split(" ")[0] + args = line.split(" ")[1:] + is_pdb_cmd = "do_" + cmd in dir(pdb.Pdb) + if cmd and (not is_pdb_cmd or len(args) > 0): + self.history.append(line) + self.pdb_history_file.store_inputs(line_num, line) + class PageControlWidget(QTextEdit, BaseEditMixin): """ diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index d20b80ba262..64182b0559b 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -9,7 +9,6 @@ mode and Spyder """ -import pdb import re from qtpy.QtCore import Qt @@ -36,6 +35,7 @@ def __init__(self, *args, **kwargs): self._input_queue = [] self._input_ready = False self._last_pdb_cmd = '' + self._pdb_line_num = 0 def set_queued_input(self, client): """Change the kernel client input function queue calls.""" @@ -58,6 +58,7 @@ def _debugging_hook(self, debugging): """Catches debugging state.""" # If debugging starts or stops, clear the input queue. self._input_queue = [] + self._pdb_line_num = 0 # --- Public API -------------------------------------------------- def write_to_stdin(self, line): @@ -124,17 +125,12 @@ def _handle_input_request(self, msg): return def callback(line): + line = line.strip() + # Save history to browse it later - if not (len(self._control.history) > 0 - and self._control.history[-1] == line): - # Do not save pdb commands unless they have arguments - cmd = line.split(" ")[0] - args = line.split(" ")[1:] - is_pdb_cmd = "do_" + cmd in dir(pdb.Pdb) - if cmd and (not is_pdb_cmd or len(args) > 0): - self._control.add_to_history(line) + self._pdb_line_num += 1 + self._control.add_to_pdb_history(self._pdb_line_num, line) - line = line.strip() if line: self._last_pdb_cmd = line From 29fb4d9a6c0e07d2ba578767d2df0d7b8e4ac677 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Wed, 14 Aug 2019 17:53:59 +0100 Subject: [PATCH 06/10] Test if debugging at callback time. --- spyder/plugins/ipythonconsole/widgets/debugging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index 64182b0559b..0e5deefcb26 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -111,8 +111,6 @@ def _handle_input_request(self, msg): # before entering readline mode. self.kernel_client.iopub_channel.flush() self._input_ready = True - if not self.is_debugging(): - return super(DebuggingWidget, self)._handle_input_request(msg) # While the widget thinks only one input is going on, # other functions can be sending messages to the kernel. @@ -125,6 +123,8 @@ def _handle_input_request(self, msg): return def callback(line): + if not self.is_debugging(): + return self.kernel_client.input(line) line = line.strip() # Save history to browse it later From 28845e155afcf720dec5420152e50b9ff629f0bb Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Fri, 16 Aug 2019 11:03:32 +0100 Subject: [PATCH 07/10] Move pdb saving to DebugingWidget --- .../plugins/ipythonconsole/widgets/control.py | 41 ------------------- .../ipythonconsole/widgets/debugging.py | 41 ++++++++++++++++++- 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py index 8d8a158af38..d940f97e5f6 100644 --- a/spyder/plugins/ipythonconsole/widgets/control.py +++ b/spyder/plugins/ipythonconsole/widgets/control.py @@ -5,13 +5,9 @@ # (see spyder/__init__.py for details) """Control widgets used by ShellWidget""" -import pdb - from qtpy.QtCore import Qt, Signal from qtpy.QtWidgets import QTextEdit -from IPython.core.history import HistoryManager -from spyder.config.base import get_conf_path from spyder.utils.qthelpers import restore_keyevent from spyder.widgets.calltip import CallTipWidget from spyder.widgets.mixins import (BaseEditMixin, GetHelpMixin, @@ -19,19 +15,6 @@ BrowseHistoryMixin) -class PdbHistory(HistoryManager): - - def _get_hist_file_name(self, profile=None): - """ - Get default pdb history file name. - - The profile parameter is ignored, but must exist for compatibility with - the parent class. - """ - - return get_conf_path('pdb_history.sqlite') - - class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, QTextEdit, BaseEditMixin): """ @@ -42,7 +25,6 @@ class ControlWidget(TracebackLinksMixin, GetHelpMixin, BrowseHistoryMixin, visibility_changed = Signal(bool) go_to_error = Signal(str) focus_changed = Signal() - PDB_HIST_MAX = 400 def __init__(self, parent=None): QTextEdit.__init__(self, parent) @@ -51,11 +33,6 @@ def __init__(self, parent=None): GetHelpMixin.__init__(self) BrowseHistoryMixin.__init__(self) - self.pdb_history_file = PdbHistory() - self.history = [line[-1] - for line in self.pdb_history_file.get_tail( - self.PDB_HIST_MAX, include_latest=True)] - self.calltip_widget = CallTipWidget(self, hide_timer_on=False) self.found_results = [] @@ -95,24 +72,6 @@ def focusOutEvent(self, event): self.focus_changed.emit() return super(ControlWidget, self).focusOutEvent(event) - def add_to_pdb_history(self, line_num, line): - """Add command to history""" - self.histidx = None - if not line: - return - line = line.strip() - - # If repeated line - if len(self.history) > 0 and self.history[-1] == line: - return - - cmd = line.split(" ")[0] - args = line.split(" ")[1:] - is_pdb_cmd = "do_" + cmd in dir(pdb.Pdb) - if cmd and (not is_pdb_cmd or len(args) > 0): - self.history.append(line) - self.pdb_history_file.store_inputs(line_num, line) - class PageControlWidget(QTextEdit, BaseEditMixin): """ diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index 0e5deefcb26..6291d82c91f 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -10,19 +10,36 @@ """ import re +import pdb +from IPython.core.history import HistoryManager from qtpy.QtCore import Qt from qtconsole.rich_jupyter_widget import RichJupyterWidget +from spyder.config.base import get_conf_path from spyder.config.manager import CONF +class PdbHistory(HistoryManager): + + def _get_hist_file_name(self, profile=None): + """ + Get default pdb history file name. + + The profile parameter is ignored, but must exist for compatibility with + the parent class. + """ + + return get_conf_path('pdb_history.sqlite') + + class DebuggingWidget(RichJupyterWidget): """ Widget with the necessary attributes and methods to handle communications between a console in debugging mode and Spyder """ + PDB_HIST_MAX = 400 def __init__(self, *args, **kwargs): super(DebuggingWidget, self).__init__(*args, **kwargs) @@ -36,6 +53,10 @@ def __init__(self, *args, **kwargs): self._input_ready = False self._last_pdb_cmd = '' self._pdb_line_num = 0 + self.pdb_history_file = PdbHistory() + self._control.history = [ + line[-1] for line in self.pdb_history_file.get_tail( + self.PDB_HIST_MAX, include_latest=True)] def set_queued_input(self, client): """Change the kernel client input function queue calls.""" @@ -129,7 +150,7 @@ def callback(line): # Save history to browse it later self._pdb_line_num += 1 - self._control.add_to_pdb_history(self._pdb_line_num, line) + self.add_to_pdb_history(self._pdb_line_num, line) if line: self._last_pdb_cmd = line @@ -196,3 +217,21 @@ def _event_filter_console_keypress(self, event): def is_debugging(self): """Check if we are debugging.""" return self.spyder_kernel_comm._debugging + + def add_to_pdb_history(self, line_num, line): + """Add command to history""" + self._control.histidx = None + if not line: + return + line = line.strip() + + # If repeated line + if len(self._control.history) > 0 and self._control.history[-1] == line: + return + + cmd = line.split(" ")[0] + args = line.split(" ")[1:] + is_pdb_cmd = "do_" + cmd in dir(pdb.Pdb) + if cmd and (not is_pdb_cmd or len(args) > 0): + self._control.history.append(line) + self.pdb_history_file.store_inputs(line_num, line) From 9b7f406567d1e85575a8e751b0a1dbfd5e7612e6 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Fri, 16 Aug 2019 13:03:46 +0100 Subject: [PATCH 08/10] Add test for history saving --- .../tests/test_ipythonconsole.py | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py index 1327bcfb6b4..44dc25de046 100644 --- a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py +++ b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py @@ -644,10 +644,11 @@ def test_request_syspath(ipyconsole, qtbot, tmpdir): @pytest.mark.slow @flaky(max_runs=10) @pytest.mark.skipif(os.name == 'nt', reason="It doesn't work on Windows") -def test_browse_history_dbg(ipyconsole, qtbot): +def test_save_history_dbg(ipyconsole, qtbot): """Test that browsing command history is working while debugging.""" shell = ipyconsole.get_current_shellwidget() - qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT) + qtbot.waitUntil(lambda: shell._prompt_html is not None, + timeout=SHELL_TIMEOUT) # Give focus to the widget that's going to receive clicks control = ipyconsole.get_focus_widget() @@ -683,6 +684,31 @@ def test_browse_history_dbg(ipyconsole, qtbot): qtbot.keyClick(control, Qt.Key_Up) assert '!aa = 10' in control.toPlainText() + # Open new widget + client_name = ipyconsole.get_current_client().get_name() + ipyconsole.create_new_client() + assert client_name != ipyconsole.get_current_client().get_name() + + shell = ipyconsole.get_current_shellwidget() + qtbot.waitUntil(lambda: shell._prompt_html is not None, + timeout=SHELL_TIMEOUT) + + # Give focus to the widget that's going to receive clicks + control = ipyconsole.get_focus_widget() + control.setFocus() + + # Generate a traceback and enter debugging mode + with qtbot.waitSignal(shell.executed): + shell.execute('1/0') + + shell.execute('%debug') + qtbot.wait(1000) + + # Press Up arrow button and assert we get the last + # introduced command + qtbot.keyClick(control, Qt.Key_Up) + assert '!aa = 10' in control.toPlainText() + @pytest.mark.slow @flaky(max_runs=3) From e083ec73a0f35547600cdfcc83a9a5849058cc9a Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Thu, 22 Aug 2019 17:19:37 +0100 Subject: [PATCH 09/10] Remove useless test --- spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | 2 -- spyder/plugins/ipythonconsole/widgets/debugging.py | 1 - 2 files changed, 3 deletions(-) diff --git a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py index 44dc25de046..5e637a8a440 100644 --- a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py +++ b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py @@ -685,9 +685,7 @@ def test_save_history_dbg(ipyconsole, qtbot): assert '!aa = 10' in control.toPlainText() # Open new widget - client_name = ipyconsole.get_current_client().get_name() ipyconsole.create_new_client() - assert client_name != ipyconsole.get_current_client().get_name() shell = ipyconsole.get_current_shellwidget() qtbot.waitUntil(lambda: shell._prompt_html is not None, diff --git a/spyder/plugins/ipythonconsole/widgets/debugging.py b/spyder/plugins/ipythonconsole/widgets/debugging.py index 6291d82c91f..724b3d8447d 100644 --- a/spyder/plugins/ipythonconsole/widgets/debugging.py +++ b/spyder/plugins/ipythonconsole/widgets/debugging.py @@ -29,7 +29,6 @@ def _get_hist_file_name(self, profile=None): The profile parameter is ignored, but must exist for compatibility with the parent class. """ - return get_conf_path('pdb_history.sqlite') From 940a4e0a4f836684bf7c121c887c05cbc9f5c247 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Fri, 23 Aug 2019 14:51:58 +0100 Subject: [PATCH 10/10] Correctly remove text when browsing history --- spyder/widgets/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyder/widgets/mixins.py b/spyder/widgets/mixins.py index fb9cfb2a2bb..72bde8c0317 100644 --- a/spyder/widgets/mixins.py +++ b/spyder/widgets/mixins.py @@ -1384,7 +1384,7 @@ def browse_history(self, backward): else: cursor_position = self.get_position('cursor') # Removing text from cursor to the end of the line - self.remove_text('cursor', 'eol') + self.remove_text('cursor', 'eof') # Inserting history text self.insert_text(text) self.set_cursor_position(cursor_position)