Prevent additional single-line if indentations [Fixes #1325]
This commit is contained in:
parent
4fe3d3b90a
commit
2404d68345
|
@ -66,8 +66,10 @@ class Pry
|
|||
#
|
||||
# :reserved and :keywords are the CodeRay 0.9.8 and 1.0.0 respectively
|
||||
# classifications of "super", "next", "return", etc.
|
||||
STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float, :keyword,
|
||||
:delimiter, :reserved]
|
||||
STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float,
|
||||
:keyword, :delimiter, :reserved,
|
||||
:instance_variable,
|
||||
:class_variable, :global_variable]
|
||||
|
||||
# Collection of tokens that should appear dedented even though they
|
||||
# don't affect the surrounding code.
|
||||
|
|
|
@ -200,6 +200,9 @@ TXT
|
|||
@indent.reset.indent("foo() if bar\n#").should == "foo() if bar\n#"
|
||||
@indent.reset.indent("foo 'hi' if bar\n#").should == "foo 'hi' if bar\n#"
|
||||
@indent.reset.indent("foo 1 while bar\n#").should == "foo 1 while bar\n#"
|
||||
@indent.reset.indent("$foo if false\n#").should == "$foo if false\n#"
|
||||
@indent.reset.indent("@foo if false\n#").should == "@foo if false\n#"
|
||||
@indent.reset.indent("@@foo if false\n#").should == "@@foo if false\n#"
|
||||
@indent.reset.indent("super if true\n#").should == "super if true\n#"
|
||||
@indent.reset.indent("true if false\n#").should == "true if false\n#"
|
||||
@indent.reset.indent("String if false\n#").should == "String if false\n#"
|
||||
|
|
Loading…
Reference in New Issue