diff --git a/spyder/plugins/history.py b/spyder/plugins/history.py index 40a3755b4fb..a93b353772a 100644 --- a/spyder/plugins/history.py +++ b/spyder/plugins/history.py @@ -217,6 +217,8 @@ def add_history(self, filename, history_list): """ if filename in self.filenames: return + #Limit history depth + history_list = history_list[-self.get_option('max_entries'):] editor = codeeditor.CodeEditor(self) editor.setup_editor(linenumbers=self.get_option('line_numbers'), language='py', @@ -259,6 +261,8 @@ def set_history(self, filename, history_list): Update the history for history filename Slot for set_history signal emitted by shell instance """ + #Limit history depth + history_list = history_list[-self.get_option('max_entries'):] if not is_text_string(filename): # filename is a QString filename = to_text_string(filename.toUtf8(), 'utf-8') index = self.filenames.index(filename)