@@ -319,7 +319,7 @@ def smarter_request_reload(desc):
319319self .current_match = None # currently tab-selected autocompletion suggestion
320320self .list_win_visible = False # whether the infobox (suggestions, docstring) is visible
321321self .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'
323323self .incremental_search_target = ''
324324
325325self .original_modules = sys .modules .keys ()
@@ -493,7 +493,7 @@ def process_key_event(self, e):
493493self .incremental_search (reverse = True )
494494elif e in ("<Esc+s>" ,):
495495self .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 :
497497self .add_to_incremental_search (self ,backspace = True )
498498elif e in self .edit_keys .cut_buffer_edits :
499499self .readline_kill (e )
@@ -538,7 +538,7 @@ def process_key_event(self, e):
538538elif e in key_dispatch [self .config .edit_current_block_key ]:
539539self .send_current_block_to_external_editor ()
540540elif e in ["<ESC>" ]:#ESC
541- self .special_mode = None
541+ self .incremental_search_mode = None
542542elif e in ["<SPACE>" ]:
543543self .add_normal_character (' ' )
544544else :
@@ -558,7 +558,7 @@ def last_word(line):
558558reset_rl_history = False )
559559
560560def incremental_search (self ,reverse = False ,include_current = False ):
561- if self .special_mode == None :
561+ if self .incremental_search_mode == None :
562562self .rl_history .enter (self .current_line )
563563self .incremental_search_target = ''
564564else :
@@ -575,9 +575,9 @@ def incremental_search(self, reverse=False, include_current=False):
575575self ._set_cursor_offset (len (self .current_line ),
576576reset_rl_history = False ,clear_special_mode = False )
577577if reverse :
578- self .special_mode = 'reverse_incremental_search'
578+ self .incremental_search_mode = 'reverse_incremental_search'
579579else :
580- self .special_mode = 'incremental_search'
580+ self .incremental_search_mode = 'incremental_search'
581581
582582def readline_kill (self ,e ):
583583func = self .edit_keys [e ]
@@ -733,7 +733,7 @@ def toggle_file_watch(self):
733733def add_normal_character (self ,char ):
734734if len (char )> 1 or is_nop (char ):
735735return
736- if self .special_mode :
736+ if self .incremental_search_mode :
737737self .add_to_incremental_search (char )
738738else :
739739self .current_line = (self .current_line [:self .cursor_offset ]+
@@ -755,9 +755,9 @@ def add_to_incremental_search(self, char=None, backspace=False):
755755self .incremental_search_target = self .incremental_search_target [:- 1 ]
756756else :
757757self .incremental_search_target += char
758- if self .special_mode == 'reverse_incremental_search' :
758+ if self .incremental_search_mode == 'reverse_incremental_search' :
759759self .incremental_search (reverse = True ,include_current = True )
760- elif self .special_mode == 'incremental_search' :
760+ elif self .incremental_search_mode == 'incremental_search' :
761761self .incremental_search (include_current = True )
762762else :
763763raise 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):
849849if err :
850850indent = 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
855855if self .current_stdouterr_line :
@@ -935,7 +935,7 @@ def current_line_formatted(self):
935935"""The colored current line (no prompt, not wrapped)"""
936936if self .config .syntax :
937937fs = bpythonparse (format (self .tokenize (self .current_line ),self .formatter ))
938- if self .special_mode :
938+ if self .incremental_search_mode :
939939if self .incremental_search_target in self .current_line :
940940fs = fmtfuncs .on_magenta (self .incremental_search_target ).join (fs .split (self .incremental_search_target ))
941941elif 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
970970def 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' :
973973return 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' :
976976return func_for_letter (self .config .color_scheme ['prompt' ])(
977977'(i-search)`%s\' : ' % (self .incremental_search_target ,))+ self .current_line_formatted
978978return (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-
10231022if about_to_exit :
10241023self .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
12341233if reset_rl_history :
12351234self .rl_history .reset ()
12361235if clear_special_mode :
1237- self .special_mode = None
1236+ self .incremental_search_mode = None
12381237self ._cursor_offset = offset
12391238self .update_completion ()
12401239cursor_offset = property (_get_cursor_offset ,_set_cursor_offset ,None ,