diff options
author | aycabta <aycabta@gmail.com> | 2021-01-09 00:40:10 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-01-13 01:12:54 +0900 |
commit | 44817db28bfc9a426732977893229e018687919d (patch) | |
tree | d0672ee71ff3de29be764350926dfaeacf37b382 /lib | |
parent | 9fa478e38abb8efc75b17ee5171fa3aa36e88dad (diff) | |
download | ruby-44817db28bfc9a426732977893229e018687919d.tar.gz |
[ruby/reline] Handle ed_search_{prev,next}_history in multiline correctly
The current line was being handled incorrectly when displaying the hit
history, so it has been fixed to be correct.
https://github.com/ruby/reline/commit/a3df4343b3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 31211cda33..3ecaef15e1 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1732,7 +1732,7 @@ class Reline::LineEditor @buffer_of_lines = Reline::HISTORY[@history_pointer].split("\n") @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty? @line_index = line_no - @line = @buffer_of_lines.last + @line = @buffer_of_lines[@line_index] @rerender_all = true else @line = Reline::HISTORY[@history_pointer] @@ -1780,7 +1780,7 @@ class Reline::LineEditor @line_index = line_no end @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty? - @line = @buffer_of_lines.last + @line = @buffer_of_lines[@line_index] @rerender_all = true else if @history_pointer.nil? and substr.empty? |