Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clarify variable names

  • Loading branch information...
commit 7d6edcbdb7b8e2adfc1e681c0eea9cfa5ac6e2bc 1 parent 8f24302
@juliantaylor authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 IPython/frontend/terminal/interactiveshell.py
View
14 IPython/frontend/terminal/interactiveshell.py
@@ -229,11 +229,11 @@ def mainloop(self, display_banner=None):
# handling seems rather unpredictable...
self.write("\nKeyboardInterrupt in interact()\n")
- def _store_multiline_history(self, source_raw, orig_hlen):
+ def _replace_rlhist_multiline(self, source_raw, hlen_before_cell):
"""Store multiple lines as a single entry in history"""
if self.multiline_history and self.has_readline:
hlen = self.readline.get_current_history_length()
- for i in range(hlen - orig_hlen):
+ for i in range(hlen - hlen_before_cell):
self.readline.remove_history_item(hlen - i - 1)
self.readline.add_history(source_raw.rstrip())
@@ -253,7 +253,7 @@ def interact(self, display_banner=None):
self.show_banner()
more = False
- hlen = self.readline.get_current_history_length()
+ hlen_before_cell = self.readline.get_current_history_length()
# Mark activity in the builtins
__builtin__.__dict__['__IPYTHON__active'] += 1
@@ -291,8 +291,8 @@ def interact(self, display_banner=None):
try:
self.write('\nKeyboardInterrupt\n')
source_raw = self.input_splitter.source_raw_reset()[1]
- self._store_multiline_history(source_raw, hlen)
- hlen = self.readline.get_current_history_length()
+ self._replace_rlhist_multiline(source_raw, hlen_before_cell)
+ hlen_before_cell = self.readline.get_current_history_length()
more = False
except KeyboardInterrupt:
pass
@@ -320,8 +320,8 @@ def interact(self, display_banner=None):
self.edit_syntax_error()
if not more:
source_raw = self.input_splitter.source_raw_reset()[1]
- self._store_multiline_history(source_raw, hlen)
- hlen = self.readline.get_current_history_length()
+ self._replace_rlhist_multiline(source_raw, hlen_before_cell)
+ hlen_before_cell = self.readline.get_current_history_length()
self.run_cell(source_raw, store_history=True)
# We are off again...
Please sign in to comment.
Something went wrong with that request. Please try again.