Skip to content

Commit

Permalink
Limit history depth
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 18, 2018
1 parent 1b4ea80 commit f0e4b7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spyder/plugins/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f0e4b7e

Please sign in to comment.