diff --git a/lib/reline/kill_ring.rb b/lib/reline/kill_ring.rb index 84d94a7ff6..201f6f3ca0 100644 --- a/lib/reline/kill_ring.rb +++ b/lib/reline/kill_ring.rb @@ -68,7 +68,7 @@ class Reline::KillRing def append(string, before_p = false) case @state when State::FRESH, State::YANK - @ring << RingPoint.new(string) + @ring << RingPoint.new(+string) @state = State::CONTINUED when State::CONTINUED, State::PROCESSED if before_p diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index b7cc6b747d..5e3a862cc6 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1256,7 +1256,7 @@ class Reline::LineEditor item_mbchars = item.grapheme_clusters end size = [memo_mbchars.size, item_mbchars.size].min - result = '' + result = +'' size.times do |i| if @config.completion_ignore_case if memo_mbchars[i].casecmp?(item_mbchars[i]) @@ -2935,7 +2935,7 @@ class Reline::LineEditor end private def ed_delete_prev_char(key, arg: 1) - deleted = '' + deleted = +'' arg.times do if @cursor > 0 byte_size = Reline::Unicode.get_prev_mbchar_size(@line, @byte_pointer) diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 6f635f630f..a22331fae5 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -85,7 +85,7 @@ class Reline::Windows def call(*args) import = @proto.split("") args.each_with_index do |x, i| - args[i], = [x == 0 ? nil : x].pack("p").unpack(POINTER_TYPE) if import[i] == "S" + args[i], = [x == 0 ? nil : +x].pack("p").unpack(POINTER_TYPE) if import[i] == "S" args[i], = [x].pack("I").unpack("i") if import[i] == "I" end ret, = @func.call(*args)