Skip to content

Commit 5de1f03

Browse files
Nick Sweetingthomasballinger
authored andcommitted
full forward and backwards history search
1 parent d895c20 commit 5de1f03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ def process_event(self, e):
337337
return
338338

339339
elif e in ("KEY_RIGHT") and self.cursor_offset == len(self.current_line):
340-
341340
self.current_line += self.current_suggestion
342341
self.cursor_offset = len(self.current_line)
343342
self.update_completion()
@@ -349,12 +348,13 @@ def process_event(self, e):
349348
# readline history commands
350349
elif e in ("KEY_UP",) + key_dispatch[self.config.up_one_line_key]:
351350
self.rl_history.enter(self.current_line)
352-
self.current_line = self.rl_history.back(False)
351+
self.current_line = self.rl_history.back(False, search=True)
353352
self.cursor_offset = len(self.current_line)
354353
self.update_completion()
354+
355355
elif e in ("KEY_DOWN",) + key_dispatch[self.config.down_one_line_key]:
356356
self.rl_history.enter(self.current_line)
357-
self.current_line = self.rl_history.forward(False)
357+
self.current_line = self.rl_history.forward(False, search=True)
358358
self.cursor_offset = len(self.current_line)
359359
self.update_completion()
360360
elif e in key_dispatch[self.config.search_key]: #TODO Not Implemented

0 commit comments

Comments
 (0)