diff options
author | tomoya ishida <[email protected]> | 2023-03-04 14:55:54 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-03-04 05:56:00 +0000 |
commit | 6f81e38d1d77931e46aee0cb054c9cb3a82f3f3b (patch) | |
tree | e2dafac0c5f19ddd4656e74e46a56607025ae19c /lib/reline/line_editor.rb | |
parent | 4782bb352eaedf934d204ea76956a26d07ec9bcf (diff) |
[ruby/reline] Fix completion with multiline
(https://github.com/ruby/reline/pull/513)
https://github.com/ruby/reline/commit/d76c482c5f
Diffstat (limited to 'lib/reline/line_editor.rb')
-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 f600536e9f..87ce7fba5d 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1371,8 +1371,8 @@ class Reline::LineEditor @completion_state = CompletionState::MENU end if not just_show_list and target < completed - @line = preposing + completed + completion_append_character.to_s + postposing - line_to_pointer = preposing + completed + completion_append_character.to_s + @line = (preposing + completed + completion_append_character.to_s + postposing).split("\n")[@line_index] || String.new(encoding: @encoding) + line_to_pointer = (preposing + completed + completion_append_character.to_s).split("\n").last || String.new(encoding: @encoding) @cursor_max = calculate_width(@line) @cursor = calculate_width(line_to_pointer) @byte_pointer = line_to_pointer.bytesize |