Skip to content

Redo #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 30, 2020
Merged

Redo #812

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated tests with new redo-friendly variable names (insert_into_hist…
…ory -> new_code)
  • Loading branch information
allgo27 committed Jun 25, 2020
commit beb450938ec9b9f87590a68814c85d207e5a6dce
4 changes: 2 additions & 2 deletions bpython/curtsiesfrontend/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ def send_session_to_external_editor(self, filename=None):
source = preprocess("\n".join(from_editor), self.interp.compile)
lines = source.split("\n")
self.history = lines
self.reevaluate(insert_into_history=True)
self.reevaluate(new_code=True)
self.current_line = current_line
self.cursor_offset = len(self.current_line)
self.status_bar.message(_("Session edited and reevaluated"))
Expand All @@ -1035,7 +1035,7 @@ def clear_modules_and_reevaluate(self):
cursor, line = self.cursor_offset, self.current_line
for modname in set(sys.modules.keys()) - self.original_modules:
del sys.modules[modname]
self.reevaluate(insert_into_history=True)
self.reevaluate(new_code=True)
self.cursor_offset, self.current_line = cursor, line
self.status_bar.message(
_("Reloaded at %s by user.") % (time.strftime("%X"),)
Expand Down
6 changes: 3 additions & 3 deletions bpython/test/test_curtsies_painting.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_run_line(self):
orig_stdout = sys.stdout
sys.stdout = self.repl.stdout
[self.repl.add_normal_character(c) for c in "1 + 1"]
self.repl.on_enter(insert_into_history=False)
self.repl.on_enter(new_code=False)
screen = fsarray([">>> 1 + 1", "2", "Welcome to"])
self.assert_paint_ignoring_formatting(screen, (1, 1))
finally:
Expand Down Expand Up @@ -248,7 +248,7 @@ def enter(self, line=None):
self.repl._set_cursor_offset(len(line), update_completion=False)
self.repl.current_line = line
with output_to_repl(self.repl):
self.repl.on_enter(insert_into_history=False)
self.repl.on_enter(new_code=False)
self.assertEqual(self.repl.rl_history.entries, [""])
self.send_refreshes()

Expand Down Expand Up @@ -592,7 +592,7 @@ def test_cursor_stays_at_bottom_of_screen(self):
self.repl.width = 50
self.repl.current_line = "__import__('random').__name__"
with output_to_repl(self.repl):
self.repl.on_enter(insert_into_history=False)
self.repl.on_enter(new_code=False)
screen = [">>> __import__('random').__name__", "'random'"]
self.assert_paint_ignoring_formatting(screen)

Expand Down