diff options
author | aycabta <aycabta@gmail.com> | 2021-09-02 04:31:01 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-09-02 14:07:40 +0900 |
commit | 5f23003cc204182134af2682f1de1e8801b3f423 (patch) | |
tree | 70b39a4cfef1d49a25a5ea9e51010d46cdc88981 /lib | |
parent | ab63f6d8543903f177c46634f38e5428655f003b (diff) |
[ruby/reline] Fix a crash when completing after 2nd line
https://github.com/ruby/reline/commit/f9d3480c34
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 3b3fc23080..9442bdf5cc 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1295,8 +1295,8 @@ class Reline::LineEditor end end completed = @completion_journey_data.list[@completion_journey_data.pointer] - @line = @completion_journey_data.preposing + completed + @completion_journey_data.postposing - line_to_pointer = @completion_journey_data.preposing + completed + @line = (@completion_journey_data.preposing + completed + @completion_journey_data.postposing).split("\n")[@line_index] + line_to_pointer = (@completion_journey_data.preposing + completed).split("\n").last @cursor_max = calculate_width(@line) @cursor = calculate_width(line_to_pointer) @byte_pointer = line_to_pointer.bytesize |