Skip to content

Commit 62002aa

Browse files
configurable key
1 parent 00be352 commit 62002aa

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

bpython/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def loadini(struct, configfile):
8080
'show_source': 'F2',
8181
'suspend': 'C-z',
8282
'undo': 'C-r',
83+
'reimport': 'F6',
8384
'search': 'C-o',
8485
'up_one_line': 'C-p',
8586
'yank_from_buffer': 'C-y'},
@@ -120,6 +121,7 @@ def loadini(struct, configfile):
120121
struct.show_source_key = config.get('keyboard', 'show_source')
121122
struct.suspend_key = config.get('keyboard', 'suspend')
122123
struct.undo_key = config.get('keyboard', 'undo')
124+
struct.reimport_key = config.get('keyboard', 'reimport')
123125
struct.up_one_line_key = config.get('keyboard', 'up_one_line')
124126
struct.down_one_line_key = config.get('keyboard', 'down_one_line')
125127
struct.cut_to_buffer_key = config.get('keyboard', 'cut_to_buffer')

bpython/curtsiesfrontend/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def process_event(self, e):
406406
self.on_tab()
407407
elif e in ("KEY_BTAB",): # shift-tab
408408
self.on_tab(back=True)
409-
elif e in ("KEY_F(6)",):
409+
elif e in key_dispatch[self.config.reimport_key]:
410410
self.clear_modules_and_reevaluate()
411411
self.update_completion()
412412
elif e in key_dispatch[self.config.undo_key]: #ctrl-r for undo

doc/sphinx/source/configuration-options.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ Default: F9
167167

168168
Shows the last output in the systems $PAGER.
169169

170+
reimport
171+
^^^^^^^^
172+
Default: F6
173+
174+
Reruns entire session, reloading all modules by clearing the sys.modules cache.
175+
176+
.. versionadded:: 0.14
177+
170178
save
171179
^^^^
172180
Default: C-s

0 commit comments

Comments
 (0)