You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we had more information readily available in the proc to generate the prompt. In order to enable adding those information over time without breaking the API all the time while doing so, I'd suggest to pass a single Struct instead of N arguments.
continuation_indicator (same as above, but a standard indicator, e.g. " for open dquote string, ' for open squote string, / for regex, * for control-statements like if/case/begin/def/class/…, { for blocks, etc.)
pry_nesting (same as current 2nd arg)
pry (same as current 3rd arg)
object (same as current 1st arg)
The text was updated successfully, but these errors were encountered:
Small amendment…
This can even be done in a backwards compatible way, leveraging to_ary:
PromptData = Struct.new(:object, :pry_nesting_level, :pry, …) do
def to_ary
warn "The use of multiple arguments in the prompt-proc is deprecated, please read …link…"
[object, pry_nesting_level, pry]
end
end
It would be nice if we had more information readily available in the proc to generate the prompt. In order to enable adding those information over time without breaking the API all the time while doing so, I'd suggest to pass a single Struct instead of N arguments.
Example, instead of:
Pry.config.prompt = proc { |obj, nest_level, _| "#{obj}:#{nest_level}> " }
use:
Pry.config.prompt = proc { |state| "#{state.object}:#{state.pry_nesting}> " }
A couple of useful information:
The text was updated successfully, but these errors were encountered: