File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 7
7
import re
8
8
import sys
9
9
import threading
10
+ import unicodedata
10
11
11
12
from bpython .autocomplete import Autocomplete , SIMPLE
12
13
from bpython .repl import Repl as BpythonRepl
@@ -451,6 +452,8 @@ def send_session_to_external_editor(self, filename=None):
451
452
## Handler Helpers
452
453
def add_normal_character (self , char ):
453
454
assert len (char ) == 1 , repr (char )
455
+ if is_nop (char ):
456
+ return
454
457
self ._current_line = (self ._current_line [:self .cursor_offset_in_line ] +
455
458
char +
456
459
self ._current_line [self .cursor_offset_in_line :])
@@ -931,6 +934,9 @@ def getstdout(self):
931
934
) if lines else ''
932
935
return s
933
936
937
+ def is_nop (char ):
938
+ return unicodedata .category (char ) == 'Cc'
939
+
934
940
def compress_paste_event (paste_event ):
935
941
"""If all events in a paste event are identical and not simple characters, returns one of them
936
942
You can’t perform that action at this time.
0 commit comments