Closed jakeonrails closed 1 year ago
FYI my defaults:
AmazingPrint.defaults
{
indent : -2,
index : false,
multiline : true,
ruby19_syntax: true
}
@jakeonrails Sounds like this is only a problem with left-justified keys using indent: -2
. Can you confirm this?
Here's the output with various settings:
# Old hash syntax, -2 indent:
AmazingPrint.defaults # =>
{
:indent => -2,
:index => false,
:multiline => true,
:ruby19_syntax => false
}
# New hash syntax, 2 indent:
AmazingPrint.defaults # =>
{
indent: 2,
index: false,
multiline: true,
ruby19_syntax: true
}
So yes I think it's only an issue with left/-2. The spacing is not great on the old hash syntax, but at least you can still copy/paste that and execute as valid ruby code. So it's really a combo of new hash + -indent.
The spaces between
one
and the:
make this invalid Ruby syntax.I would expect: