Skip to content

Commit 76892ca

Browse files
add keys
1 parent 07d8d53 commit 76892ca

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

bpython/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ def loadini(struct, configfile):
107107
'exit': '',
108108
'external_editor': 'F7',
109109
'help': 'F1',
110+
'incremental_search': 'M-s',
110111
'last_output': 'F9',
111112
'left': 'C-b',
112113
'pastebin': 'F8',
113114
'reimport': 'F6',
115+
'reverse_incremental_search': 'M-r',
114116
'right': 'C-f',
115117
'save': 'C-s',
116118
'search': 'C-o',
@@ -185,6 +187,9 @@ def get_key_no_doublebind(command):
185187
struct.toggle_file_watch_key = get_key_no_doublebind('toggle_file_watch')
186188
struct.undo_key = get_key_no_doublebind('undo')
187189
struct.reimport_key = get_key_no_doublebind('reimport')
190+
struct.reverse_incremental_search_key = get_key_no_doublebind(
191+
'reverse_incremental_search')
192+
struct.incremental_search_key = get_key_no_doublebind('incremental_search')
188193
struct.up_one_line_key = get_key_no_doublebind('up_one_line')
189194
struct.down_one_line_key = get_key_no_doublebind('down_one_line')
190195
struct.cut_to_buffer_key = get_key_no_doublebind('cut_to_buffer')

bpython/curtsiesfrontend/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,9 @@ def process_key_event(self, e):
611611
self.on_control_d()
612612
elif e in ("<Esc+.>",):
613613
self.get_last_word()
614-
elif e in ("<Esc+r>",):
614+
elif e in key_dispatch[self.config.reverse_incremental_search_key]:
615615
self.incremental_search(reverse=True)
616-
elif e in ("<Esc+s>",):
616+
elif e in key_dispatch[self.config.incremental_search_key]:
617617
self.incremental_search()
618618
elif (e in ("<BACKSPACE>",) + key_dispatch[self.config.backspace_key]
619619
and self.incremental_search_mode):

bpython/sample-config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
# exit = C-d
7878
# external_editor = F7
7979
# edit_config = F3
80+
# reverse_incremental_search = M-r
81+
# incremental_search = M-s
8082

8183
[curtsies]
8284

0 commit comments

Comments
 (0)