summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2022-01-13 20:29:07 +0900
committergit <svn-admin@ruby-lang.org>2022-01-16 22:09:31 +0900
commitf5e3913737916df3bc569dee7d3c9c9ed98146b3 (patch)
tree3386aa6d879aa3d79917c97b61e61ee027676d31 /lib
parent921ff739df14c705491d75435c5e5ce31e2ed553 (diff)
downloadruby-f5e3913737916df3bc569dee7d3c9c9ed98146b3.tar.gz
[ruby/reline] Fix incremental search to work correctly even if not last line
https://github.com/ruby/reline/commit/21d75f6d4c
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 82bd36d4b3..135432a5d1 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -2233,6 +2233,8 @@ class Reline::LineEditor
@buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty?
@line_index = @buffer_of_lines.size - 1
@line = @buffer_of_lines.last
+ @byte_pointer = @line.bytesize
+ @cursor = @cursor_max = calculate_width(@line)
@rerender_all = true
@searching_prompt = "(%s)`%s'" % [prompt_name, search_word]
else