Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since #500 (revision
364a6d56
), thePROMPT_N
prompt format is no longer used (explanation follows). This change removes it.The only usage of
PROMPT_N
's value is inIRB::Irb#eval_input
:irb/lib/irb.rb
Lines 522 to 534 in 65e8e68
In order for
@context.prompt_n
to be used here,continue
must be falsey andindent
must be positive.That block given to
set_prompt
is called only byRubyLex#prompt
:irb/lib/irb/ruby-lex.rb
Lines 157 to 161 in 65e8e68
In order to satisfy the conditions above,
opens
must be empty (technically it could also be populated with only falsey values, but that's not the case here) andcalc_indent_level(opens)
must be positive.RubyLex#calc_indent_level
is defined as:irb/lib/irb/ruby-lex.rb
Lines 365 to 388 in 65e8e68
If
opens
is empty, then the block given toopens.each_with_index
will never be evaluated, andcalc_indent_level
will return the initial value ofindent_level
:0
. Thereforecalc_indent_level(opens)
cannot be positive whileopens
is empty.Since these conditions cannot be satisfied,
PROMPT_N
will never be used.However, maybe it's unintended that
PROMPT_N
is unused now, in which case I can close this PR.