Skip to content

Commit 6ab499b

Browse files
ignore completion until the end of a paste event
1 parent 460d7f0 commit 6ab499b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,8 @@ def in_paste_mode(self):
13111311
self.paste_mode = True
13121312
yield
13131313
self.paste_mode = orig_value
1314+
if not self.paste_mode:
1315+
self.update_completion()
13141316

13151317
# Debugging shims, good example of embedding a Repl in other code
13161318
def dumb_print_output(self):
@@ -1375,6 +1377,8 @@ def _set_current_line(self, line, update_completion=True,
13751377
if self._current_line == line:
13761378
return
13771379
self._current_line = line
1380+
if self.paste_mode:
1381+
return
13781382
if update_completion:
13791383
self.update_completion()
13801384
if reset_rl_history:
@@ -1392,6 +1396,10 @@ def _set_cursor_offset(self, offset, update_completion=True,
13921396
reset_rl_history=False, clear_special_mode=True):
13931397
if self._cursor_offset == offset:
13941398
return
1399+
if self.paste_mode:
1400+
self._cursor_offset = offset
1401+
self.unhighlight_paren()
1402+
return
13951403
if reset_rl_history:
13961404
self.rl_history.reset()
13971405
if clear_special_mode:

0 commit comments

Comments
 (0)