Skip to content

Commit

Permalink
Changed history name
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 22, 2018
1 parent 4762d7b commit 1a4ef97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spyder/app/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ def post_visible_setup(self):
# Show history file if no console is visible
if not self.ipyconsole.isvisible:
self.historylog.add_history(
"iPython history",
self.ipyconsole.history_title,
self.ipyconsole.get_current_shellwidget()._history)

if self.open_project:
Expand Down
2 changes: 1 addition & 1 deletion spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ def test_history(main_window, qtbot):

commands_text = ''.join(commands)

index = main_window.historylog.filenames.index("iPython history")
index = main_window.historylog.filenames.index(main_window.ipyconsole.history_title)
assert index == 0
text = main_window.historylog.editors[index].toPlainText()[-len(commands_text):]
history = main_window.historylog.histories[index][-len(clients):]
Expand Down
7 changes: 4 additions & 3 deletions spyder/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ def __init__(self, parent, testing=False, test_dir=TEMPDIR,

self.tabwidget = None
self.menu_actions = None
self.history_title = "History"

self.help = None # Help plugin
self.historylog = None # History log plugin
Expand Down Expand Up @@ -1310,16 +1311,16 @@ def register_client(self, client, give_focus=True):
# Connect client to our history log
if self.historylog is not None:
self.historylog.add_history(
"iPython history",
self.history_title,
shellwidget.history_tail(
self.historylog.get_option('max_entries')))
# To save history
shellwidget.sig_new_history.connect(
lambda history: self.historylog.set_history(
"iPython history", history))
self.history_title, history))
shellwidget.executing.connect(
lambda command: self.historylog.append_to_history(
"iPython history", command))
self.history_title, command))


# Set font for client
Expand Down

0 comments on commit 1a4ef97

Please sign in to comment.