@@ -483,13 +483,13 @@ def request_undo(self, n=1):
483
483
"""Like request_refresh, but for undo request events."""
484
484
raise NotImplementedError
485
485
486
- def on_suspend ():
486
+ def on_suspend (self ):
487
487
"""Will be called on sigtstp.
488
488
489
489
Do whatever cleanup would allow the user to use other programs."""
490
490
raise NotImplementedError
491
491
492
- def after_suspend ():
492
+ def after_suspend (self ):
493
493
"""Will be called when process foregrounded after suspend.
494
494
495
495
See to it that process_event is called with None to trigger a refresh
@@ -675,6 +675,8 @@ def process_key_event(self, e):
675
675
self .down_one_line ()
676
676
elif e in ("<Ctrl-d>" ,):
677
677
self .on_control_d ()
678
+ elif e in ("<Ctrl-o>" ,):
679
+ self .on_control_o ()
678
680
elif e in ("<Esc+.>" ,):
679
681
self .get_last_word ()
680
682
elif e in key_dispatch [self .config .reverse_incremental_search_key ]:
@@ -844,6 +846,13 @@ def on_control_d(self):
844
846
self .current_line = (self .current_line [:self .cursor_offset ] +
845
847
self .current_line [(self .cursor_offset + 1 ):])
846
848
849
+ def on_control_o (self ):
850
+ next_idx = - self .rl_history .index + 1
851
+ next = self .rl_history .entries [next_idx ]
852
+ self .on_enter ()
853
+ print ("Next is : " + next )
854
+ self ._set_current_line (next )
855
+
847
856
def cut_to_buffer (self ):
848
857
self .cut_buffer = self .current_line [self .cursor_offset :]
849
858
self .current_line = self .current_line [:self .cursor_offset ]
@@ -958,18 +967,24 @@ def toggle_file_watch(self):
958
967
959
968
# Handler Helpers
960
969
def add_normal_character (self , char ):
970
+ print ("Char is :" + str (char ))
961
971
if len (char ) > 1 or is_nop (char ):
962
972
return
963
973
if self .incr_search_mode :
974
+ print ("Incr search mode" )
964
975
self .add_to_incremental_search (char )
965
976
else :
977
+ print ("In here current line: " + self .current_line )
978
+
966
979
self ._set_current_line ((self .current_line [:self .cursor_offset ] +
967
980
char +
968
981
self .current_line [self .cursor_offset :]),
969
982
update_completion = False ,
970
983
reset_rl_history = False ,
971
984
clear_special_mode = False )
972
985
self .cursor_offset += 1
986
+
987
+ print ("but here: " + self .current_line )
973
988
if (self .config .cli_trim_prompts and
974
989
self .current_line .startswith (self .ps1 )):
975
990
self .current_line = self .current_line [4 :]
@@ -1021,6 +1036,7 @@ def push(self, line, insert_into_history=True):
1021
1036
1022
1037
If the interpreter successfully runs the code, clear the buffer
1023
1038
"""
1039
+
1024
1040
if self .paste_mode :
1025
1041
self .saved_indent = 0
1026
1042
else :
@@ -1187,6 +1203,7 @@ def current_line_formatted(self):
1187
1203
self .old_fs = fs
1188
1204
return fs
1189
1205
1206
+
1190
1207
@property
1191
1208
def lines_for_display (self ):
1192
1209
"""All display lines (wrapped, colored, with prompts)"""
0 commit comments