File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed 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
@@ -451,6 +452,8 @@ def send_session_to_external_editor(self, filename=None):
451452 ## Handler Helpers
452453 def add_normal_character (self , char ):
453454 assert len (char ) == 1 , repr (char )
455+ if is_nop (char ):
456+ return
454457 self ._current_line = (self ._current_line [:self .cursor_offset_in_line ] +
455458 char +
456459 self ._current_line [self .cursor_offset_in_line :])
@@ -931,6 +934,9 @@ def getstdout(self):
931934 ) if lines else ''
932935 return s
933936
937+ def is_nop (char ):
938+ return unicodedata .category (char ) == 'Cc'
939+
934940def compress_paste_event (paste_event ):
935941 """If all events in a paste event are identical and not simple characters, returns one of them
936942
You can’t perform that action at this time.
0 commit comments