pry
pry copied to clipboard
Pasting more than x lines of hash breaks pry
So If I paste the next code:
customer = {
name: "John Doe",
email: "[email protected]",
address: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address1: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address2: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address3: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address4: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address5: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
postal_code: "12345",
country: "USA"
},
address6: {
street1: "123 account st",
street2: "",
city: "los angeles",
state: "CA",
}
}
It breaks pry because it cannot find the end of the hash, it doesn't depend on the amount of lines, it depends on the amount of chars. This doesn't hapen with irb
I have ruby 2.4.4, pry 0.11.3
It appears to be due to our syntax "correct indent" code, which irb doesn't have
try typing this in pry before you paste _pry_.config.correct_indent = false
thanks, but that didn't work
Hmm really?
Try this then:
_pry_.config.auto_indent = false
and then pasting :)
that worked, but I can't put this config for just this case, should I close this issue? I think it should be fixed, but that's my opinion
Got similar situation, but I was not pasting hash keys but nearly 70 lines of code, the cmd window (win7,ruby2.5.1,msys2) just hang, I can ctrl+c but the pry won't respond to any other keys afterwards.
If I copy within 20lines or so, it's okay.
Btw, Is there a way to load an rb file and keep the environment created by the rb file after the rb file excuting finished?(like python's execfile) -- Or, if I can specify which lines to load in to pry environment, that's even better.
Thanks :)
I can reproduce this only when I use tmux. This is a valid bug, and a very annoying one :)
Indeed. I had to switch to irb today. :)
Yep, I try pasting smaller chunks of code, until this is resolved.
None of this helps:
_pry_.config.correct_indent = false
_pry_.config.auto_indent = false
🔴