Skip to content

Commit 99c10ca

Browse files
current line no longer lost when sent to and from editor
--HG-- branch : scroll-frontend
1 parent 2f64705 commit 99c10ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,12 @@ def send_to_external_editor(self, filename=None):
848848
for line in text.split('\n')).encode('utf8'))
849849
temp.flush()
850850
subprocess.call(editor_args + [temp.name])
851-
self.history = [line for line in open(temp.name).read().split('\n')
851+
lines = open(temp.name).read().split('\n')
852+
self.history = [line for line in lines
852853
if line[:4] != '### ']
853854
self.reevaluate(insert_into_history=True)
855+
self._current_line = lines[-1][4:]
856+
self.cursor_offset_in_line = len(self._current_line)
854857

855858
def simple_repl():
856859
refreshes = []

0 commit comments

Comments
 (0)