File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import re
88import sys
99import threading
10+ import unicodedata
1011
1112from bpython .autocomplete import Autocomplete , SIMPLE
1213from bpython .repl import Repl as BpythonRepl
@@ -453,6 +454,8 @@ def send_session_to_external_editor(self, filename=None):
453454 ## Handler Helpers
454455 def add_normal_character (self , char ):
455456 assert len (char ) == 1 , repr (char )
457+ if is_nop (char ):
458+ return
456459 self ._current_line = (self ._current_line [:self .cursor_offset_in_line ] +
457460 char +
458461 self ._current_line [self .cursor_offset_in_line :])
@@ -938,6 +941,9 @@ def getstdout(self):
938941 ) if lines else ''
939942 return s
940943
944+ def is_nop (char ):
945+ return unicodedata .category (char ) == 'Cc'
946+
941947def compress_paste_event (paste_event ):
942948 """If all events in a paste event are identical and not simple characters, returns one of them
943949
You can’t perform that action at this time.
0 commit comments