From 4762d7b17b81c6d61889b9c4a24635dbdd054516 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Fri, 18 May 2018 09:48:20 +0100 Subject: [PATCH] Limit history depth --- spyder/plugins/history.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spyder/plugins/history.py b/spyder/plugins/history.py index 887da9c0c70..d31197dd365 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)