summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-12-01 23:53:59 +0900
committeraycabta <aycabta@gmail.com>2019-12-01 23:54:57 +0900
commit8cb3f29abf9290838bdc3b9904868c78752427e8 (patch)
tree5cc9beecdf57ecd0dbb898130bc8b0ba093430f7 /lib
parentf1cfc7da180a8cf26f758fbe553e6653e4a4dc53 (diff)
The ed_search_prev_history should always search to backward
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 71d765109d..8c0b858747 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -1175,7 +1175,12 @@ class Reline::LineEditor
@history_pointer = nil
hit = @line_backup_in_history
else
- hit_index = Reline::HISTORY.rindex { |item|
+ if @history_pointer
+ history = Reline::HISTORY[0..@history_pointer]
+ else
+ history = Reline::HISTORY
+ end
+ hit_index = history.rindex { |item|
item.include?(search_word)
}
if hit_index