@@ -319,7 +319,7 @@ def smarter_request_reload(desc):
319
319
self .current_match = None # currently tab-selected autocompletion suggestion
320
320
self .list_win_visible = False # whether the infobox (suggestions, docstring) is visible
321
321
self .watching_files = False # auto reloading turned on
322
- self .special_mode = None # 'reverse_incremental_search' and 'incremental_search'
322
+ self .incremental_search_mode = None # 'reverse_incremental_search' and 'incremental_search'
323
323
self .incremental_search_target = ''
324
324
325
325
self .original_modules = sys .modules .keys ()
@@ -493,7 +493,7 @@ def process_key_event(self, e):
493
493
self .incremental_search (reverse = True )
494
494
elif e in ("<Esc+s>" ,):
495
495
self .incremental_search ()
496
- elif e in ("<BACKSPACE>" , '<Ctrl-h>' ) and self .special_mode :
496
+ elif e in ("<BACKSPACE>" , '<Ctrl-h>' ) and self .incremental_search_mode :
497
497
self .add_to_incremental_search (self , backspace = True )
498
498
elif e in self .edit_keys .cut_buffer_edits :
499
499
self .readline_kill (e )
@@ -538,7 +538,7 @@ def process_key_event(self, e):
538
538
elif e in key_dispatch [self .config .edit_current_block_key ]:
539
539
self .send_current_block_to_external_editor ()
540
540
elif e in ["<ESC>" ]: #ESC
541
- self .special_mode = None
541
+ self .incremental_search_mode = None
542
542
elif e in ["<SPACE>" ]:
543
543
self .add_normal_character (' ' )
544
544
else :
@@ -558,7 +558,7 @@ def last_word(line):
558
558
reset_rl_history = False )
559
559
560
560
def incremental_search (self , reverse = False , include_current = False ):
561
- if self .special_mode == None :
561
+ if self .incremental_search_mode == None :
562
562
self .rl_history .enter (self .current_line )
563
563
self .incremental_search_target = ''
564
564
else :
@@ -575,9 +575,9 @@ def incremental_search(self, reverse=False, include_current=False):
575
575
self ._set_cursor_offset (len (self .current_line ),
576
576
reset_rl_history = False , clear_special_mode = False )
577
577
if reverse :
578
- self .special_mode = 'reverse_incremental_search'
578
+ self .incremental_search_mode = 'reverse_incremental_search'
579
579
else :
580
- self .special_mode = 'incremental_search'
580
+ self .incremental_search_mode = 'incremental_search'
581
581
582
582
def readline_kill (self , e ):
583
583
func = self .edit_keys [e ]
@@ -733,7 +733,7 @@ def toggle_file_watch(self):
733
733
def add_normal_character (self , char ):
734
734
if len (char ) > 1 or is_nop (char ):
735
735
return
736
- if self .special_mode :
736
+ if self .incremental_search_mode :
737
737
self .add_to_incremental_search (char )
738
738
else :
739
739
self .current_line = (self .current_line [:self .cursor_offset ] +
@@ -755,9 +755,9 @@ def add_to_incremental_search(self, char=None, backspace=False):
755
755
self .incremental_search_target = self .incremental_search_target [:- 1 ]
756
756
else :
757
757
self .incremental_search_target += char
758
- if self .special_mode == 'reverse_incremental_search' :
758
+ if self .incremental_search_mode == 'reverse_incremental_search' :
759
759
self .incremental_search (reverse = True , include_current = True )
760
- elif self .special_mode == 'incremental_search' :
760
+ elif self .incremental_search_mode == 'incremental_search' :
761
761
self .incremental_search (include_current = True )
762
762
else :
763
763
raise ValueError ('add_to_incremental_search should only be called in a special mode' )
@@ -849,7 +849,7 @@ def run_code_and_maybe_finish(self, for_code=None):
849
849
if err :
850
850
indent = 0
851
851
852
-
852
+
853
853
#TODO This should be printed ABOVE the error that just happened instead
854
854
# or maybe just thrown away and not shown
855
855
if self .current_stdouterr_line :
@@ -935,7 +935,7 @@ def current_line_formatted(self):
935
935
"""The colored current line (no prompt, not wrapped)"""
936
936
if self .config .syntax :
937
937
fs = bpythonparse (format (self .tokenize (self .current_line ), self .formatter ))
938
- if self .special_mode :
938
+ if self .incremental_search_mode :
939
939
if self .incremental_search_target in self .current_line :
940
940
fs = fmtfuncs .on_magenta (self .incremental_search_target ).join (fs .split (self .incremental_search_target ))
941
941
elif self .rl_history .saved_line and self .rl_history .saved_line in self .current_line :
@@ -969,10 +969,10 @@ def display_buffer_lines(self):
969
969
@property
970
970
def display_line_with_prompt (self ):
971
971
"""colored line with prompt"""
972
- if self .special_mode == 'reverse_incremental_search' :
972
+ if self .incremental_search_mode == 'reverse_incremental_search' :
973
973
return func_for_letter (self .config .color_scheme ['prompt' ])(
974
974
'(reverse-i-search)`%s\' : ' % (self .incremental_search_target ,)) + self .current_line_formatted
975
- elif self .special_mode == 'incremental_search' :
975
+ elif self .incremental_search_mode == 'incremental_search' :
976
976
return func_for_letter (self .config .color_scheme ['prompt' ])(
977
977
'(i-search)`%s\' : ' % (self .incremental_search_target ,)) + self .current_line_formatted
978
978
return (func_for_letter (self .config .color_scheme ['prompt' ])(self .ps1 )
@@ -1019,7 +1019,6 @@ def paint(self, about_to_exit=False, user_quit=False):
1019
1019
less state is cool!
1020
1020
"""
1021
1021
# The hairiest function in the curtsies - a cleanup would be great.
1022
-
1023
1022
if about_to_exit :
1024
1023
self .clean_up_current_line_for_exit () # exception to not changing state!
1025
1024
@@ -1234,7 +1233,7 @@ def _set_cursor_offset(self, offset, update_completion=True, reset_rl_history=Fa
1234
1233
if reset_rl_history :
1235
1234
self .rl_history .reset ()
1236
1235
if clear_special_mode :
1237
- self .special_mode = None
1236
+ self .incremental_search_mode = None
1238
1237
self ._cursor_offset = offset
1239
1238
self .update_completion ()
1240
1239
cursor_offset = property (_get_cursor_offset , _set_cursor_offset , None ,
0 commit comments