Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2fd9798

Browse filesBrowse files
take back line working for bpythno-curtsies
1 parent b80b400 commit 2fd9798
Copy full SHA for 2fd9798

2 files changed

+11-2Lines changed: 11 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/curtsiesfrontend/repl.py‎

Copy file name to clipboardExpand all lines: bpython/curtsiesfrontend/repl.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,13 @@ def reprint_line(self, lineno, tokens):
11931193
logger.debug("calling reprint line with %r %r", lineno, tokens)
11941194
if self.config.syntax:
11951195
self.display_buffer[lineno] = bpythonparse(format(tokens, self.formatter))
1196+
1197+
def take_back_buffer_line(self):
1198+
self.display_buffer.pop()
1199+
self.buffer.pop()
1200+
self.cursor_offset = 0
1201+
self.current_line = ''
1202+
11961203
def reevaluate(self, insert_into_history=False):
11971204
"""bpython.Repl.undo calls this"""
11981205
if self.watcher: self.watcher.reset()
Collapse file

‎bpython/repl.py‎

Copy file name to clipboardExpand all lines: bpython/repl.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,10 @@ def undo(self, n=1):
902902
entries = list(self.rl_history.entries)
903903

904904
self.history = self.history[:-n]
905-
906-
self.reevaluate()
905+
if n == 1 and not self.done:
906+
self.take_back_buffer_line()
907+
else:
908+
self.reevaluate()
907909

908910
self.rl_history.entries = entries
909911

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.