@@ -319,7 +319,7 @@ def smarter_request_reload(desc):
319319 self .current_match = None # currently tab-selected autocompletion suggestion
320320 self .list_win_visible = False # whether the infobox (suggestions, docstring) is visible
321321 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'
323323 self .incremental_search_target = ''
324324
325325 self .original_modules = sys .modules .keys ()
@@ -493,7 +493,7 @@ def process_key_event(self, e):
493493 self .incremental_search (reverse = True )
494494 elif e in ("<Esc+s>" ,):
495495 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 :
497497 self .add_to_incremental_search (self , backspace = True )
498498 elif e in self .edit_keys .cut_buffer_edits :
499499 self .readline_kill (e )
@@ -538,7 +538,7 @@ def process_key_event(self, e):
538538 elif e in key_dispatch [self .config .edit_current_block_key ]:
539539 self .send_current_block_to_external_editor ()
540540 elif e in ["<ESC>" ]: #ESC
541- self .special_mode = None
541+ self .incremental_search_mode = None
542542 elif e in ["<SPACE>" ]:
543543 self .add_normal_character (' ' )
544544 else :
@@ -558,7 +558,7 @@ def last_word(line):
558558 reset_rl_history = False )
559559
560560 def incremental_search (self , reverse = False , include_current = False ):
561- if self .special_mode == None :
561+ if self .incremental_search_mode == None :
562562 self .rl_history .enter (self .current_line )
563563 self .incremental_search_target = ''
564564 else :
@@ -575,9 +575,9 @@ def incremental_search(self, reverse=False, include_current=False):
575575 self ._set_cursor_offset (len (self .current_line ),
576576 reset_rl_history = False , clear_special_mode = False )
577577 if reverse :
578- self .special_mode = 'reverse_incremental_search'
578+ self .incremental_search_mode = 'reverse_incremental_search'
579579 else :
580- self .special_mode = 'incremental_search'
580+ self .incremental_search_mode = 'incremental_search'
581581
582582 def readline_kill (self , e ):
583583 func = self .edit_keys [e ]
@@ -733,7 +733,7 @@ def toggle_file_watch(self):
733733 def add_normal_character (self , char ):
734734 if len (char ) > 1 or is_nop (char ):
735735 return
736- if self .special_mode :
736+ if self .incremental_search_mode :
737737 self .add_to_incremental_search (char )
738738 else :
739739 self .current_line = (self .current_line [:self .cursor_offset ] +
@@ -755,9 +755,9 @@ def add_to_incremental_search(self, char=None, backspace=False):
755755 self .incremental_search_target = self .incremental_search_target [:- 1 ]
756756 else :
757757 self .incremental_search_target += char
758- if self .special_mode == 'reverse_incremental_search' :
758+ if self .incremental_search_mode == 'reverse_incremental_search' :
759759 self .incremental_search (reverse = True , include_current = True )
760- elif self .special_mode == 'incremental_search' :
760+ elif self .incremental_search_mode == 'incremental_search' :
761761 self .incremental_search (include_current = True )
762762 else :
763763 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):
849849 if err :
850850 indent = 0
851851
852-
852+
853853 #TODO This should be printed ABOVE the error that just happened instead
854854 # or maybe just thrown away and not shown
855855 if self .current_stdouterr_line :
@@ -935,7 +935,7 @@ def current_line_formatted(self):
935935 """The colored current line (no prompt, not wrapped)"""
936936 if self .config .syntax :
937937 fs = bpythonparse (format (self .tokenize (self .current_line ), self .formatter ))
938- if self .special_mode :
938+ if self .incremental_search_mode :
939939 if self .incremental_search_target in self .current_line :
940940 fs = fmtfuncs .on_magenta (self .incremental_search_target ).join (fs .split (self .incremental_search_target ))
941941 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):
969969 @property
970970 def display_line_with_prompt (self ):
971971 """colored line with prompt"""
972- if self .special_mode == 'reverse_incremental_search' :
972+ if self .incremental_search_mode == 'reverse_incremental_search' :
973973 return func_for_letter (self .config .color_scheme ['prompt' ])(
974974 '(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' :
976976 return func_for_letter (self .config .color_scheme ['prompt' ])(
977977 '(i-search)`%s\' : ' % (self .incremental_search_target ,)) + self .current_line_formatted
978978 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):
10191019 less state is cool!
10201020 """
10211021 # The hairiest function in the curtsies - a cleanup would be great.
1022-
10231022 if about_to_exit :
10241023 self .clean_up_current_line_for_exit () # exception to not changing state!
10251024
@@ -1234,7 +1233,7 @@ def _set_cursor_offset(self, offset, update_completion=True, reset_rl_history=Fa
12341233 if reset_rl_history :
12351234 self .rl_history .reset ()
12361235 if clear_special_mode :
1237- self .special_mode = None
1236+ self .incremental_search_mode = None
12381237 self ._cursor_offset = offset
12391238 self .update_completion ()
12401239 cursor_offset = property (_get_cursor_offset , _set_cursor_offset , None ,
0 commit comments