irb icon indicating copy to clipboard operation
irb copied to clipboard

Copy&Paste code with TAB symbol inserts `source` into the code which makes it `void value expression`

Open vimutter opened this issue 3 years ago • 0 comments

Description

IRB Copy&Pasting code with TAB symbol inserts source into the code which makes it void value expression.

Essentially if you want to quick test run some code from editor which contains TAB, code inserted gets altered which makes it invalid.

Test code

def test
  loop do
  	break # Here is <space><space><tab>break
  end
end

If you paste it gets entered as:

def test
  loop do
source break 
  end
end

Result of irb_info

Ruby version: 3.1.1
IRB version: irb 1.4.1 (2021-12-25)
InputMethod: ReidlineInputMethod with Reline 0.3.0
.irbrc path: /home/user/.rvm/rubies/ruby-3.1.1/.irbrc
RUBY_PLATFORM: x86_64-linux
LANG env: C.UTF-8
East Asian Ambiguous Width: 1

vimutter avatar Jul 25 '22 11:07 vimutter