[ruby/irb] Fix indentation of xstring literal
(https://github.com/ruby/irb/pull/1038) Fixes indent calculation of this input ``` if false p `ls` end ``` https://github.com/ruby/irb/commit/4217a46f5d
This commit is contained in:
parent
c192d688d1
commit
def684508c
@ -159,7 +159,7 @@ module IRB
|
|||||||
when :on_heredoc_end
|
when :on_heredoc_end
|
||||||
opens.pop
|
opens.pop
|
||||||
when :on_backtick
|
when :on_backtick
|
||||||
opens << [t, nil] if t.state.allbits?(Ripper::EXPR_BEG)
|
opens << [t, nil] unless t.state == Ripper::EXPR_ARG
|
||||||
when :on_tstring_beg, :on_words_beg, :on_qwords_beg, :on_symbols_beg, :on_qsymbols_beg, :on_regexp_beg
|
when :on_tstring_beg, :on_words_beg, :on_qwords_beg, :on_symbols_beg, :on_qsymbols_beg, :on_regexp_beg
|
||||||
opens << [t, nil]
|
opens << [t, nil]
|
||||||
when :on_tstring_end, :on_regexp_end, :on_label_end
|
when :on_tstring_end, :on_regexp_end, :on_label_end
|
||||||
|
@ -59,6 +59,7 @@ module TestIRB
|
|||||||
def f() = 1
|
def f() = 1
|
||||||
%(); %w[]; %q(); %r{}; %i[]
|
%(); %w[]; %q(); %r{}; %i[]
|
||||||
"#{1}"; ''; /#{1}/; `#{1}`
|
"#{1}"; ''; /#{1}/; `#{1}`
|
||||||
|
p(``); p ``; p x: ``; p 1, ``;
|
||||||
:sym; :"sym"; :+; :`; :if
|
:sym; :"sym"; :+; :`; :if
|
||||||
[1, 2, 3]
|
[1, 2, 3]
|
||||||
{ x: 1, y: 2 }
|
{ x: 1, y: 2 }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user